pub struct BrowserLoginToken {
pub login: LoginOptions,
pub store: Option<Arc<dyn LoginStore>>,
pub audience: String,
pub no_browser: bool,
pub login_timeout: Option<Duration>,
}Expand description
A TokenSource backed by the library’s own login: it mints tokens from the saved refresh
token, and when there is none (or it has expired) runs browser_login, unless no_browser is
set. Wrap it in cached. Concurrent processes share the saved login safely.
Fields§
§login: LoginOptions§store: Option<Arc<dyn LoginStore>>Defaults to FileLoginStore at default_login_file.
audience: StringThe audience of the returned tokens; defaults to DEFAULT_AUDIENCE.
no_browser: boolFail with Error::LoginRequired instead of opening a browser.
login_timeout: Option<Duration>Bounds a browser login (default 10 minutes).
Trait Implementations§
Source§impl Clone for BrowserLoginToken
impl Clone for BrowserLoginToken
Source§fn clone(&self) -> BrowserLoginToken
fn clone(&self) -> BrowserLoginToken
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BrowserLoginToken
impl Debug for BrowserLoginToken
Source§impl Default for BrowserLoginToken
impl Default for BrowserLoginToken
Source§fn default() -> BrowserLoginToken
fn default() -> BrowserLoginToken
Returns the “default value” for a type. Read more
Source§impl TokenSource for BrowserLoginToken
impl TokenSource for BrowserLoginToken
Auto Trait Implementations§
impl Freeze for BrowserLoginToken
impl !RefUnwindSafe for BrowserLoginToken
impl Send for BrowserLoginToken
impl Sync for BrowserLoginToken
impl Unpin for BrowserLoginToken
impl UnsafeUnpin for BrowserLoginToken
impl !UnwindSafe for BrowserLoginToken
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].