pub struct TokenManager<S: CredentialSource, C: Clock = SystemClock, E: TokenExchanger = OAuthClient> { /* private fields */ }Implementations§
Source§impl<S: CredentialSource> TokenManager<S>
impl<S: CredentialSource> TokenManager<S>
pub fn new(source: S, policy: ExchangePolicy) -> Result<Self, Error>
Source§impl<S: CredentialSource, C: Clock> TokenManager<S, C, OAuthClient>
impl<S: CredentialSource, C: Clock> TokenManager<S, C, OAuthClient>
pub fn with_clock( source: S, policy: ExchangePolicy, clock: C, ) -> Result<Self, Error>
Source§impl<S: CredentialSource, C: Clock, E: TokenExchanger + 'static> TokenManager<S, C, E>
impl<S: CredentialSource, C: Clock, E: TokenExchanger + 'static> TokenManager<S, C, E>
pub fn with_exchanger( source: S, exchanger: E, refresh_skew: Duration, clock: C, ) -> Self
pub fn with_scope(self, scope: impl Into<String>) -> Self
pub fn with_observer(self, observer: Arc<dyn RefreshObserver>) -> Self
pub async fn token(&self) -> Result<AccessToken, Error>
pub async fn refresh_now(&self) -> Result<AccessToken, Error>
pub async fn refresh_if_changed(&self) -> Result<AccessToken, Error>
pub async fn invalidate(&self)
pub async fn state(&self) -> TokenState
pub async fn fingerprint(&self) -> Option<String>
pub async fn shutdown(&self)
pub async fn ready(&self) -> bool
pub fn refresh_count(&self) -> u64
pub fn failure_count(&self) -> u64
pub fn spawn_proactive_refresh(
self: Arc<Self>,
interval: Duration,
) -> JoinHandle<()> ⓘwhere
S: 'static,
C: 'static,
Auto Trait Implementations§
impl<S, C = SystemClock, E = OAuthClient> !Freeze for TokenManager<S, C, E>
impl<S, C = SystemClock, E = OAuthClient> !RefUnwindSafe for TokenManager<S, C, E>
impl<S, C = SystemClock, E = OAuthClient> !UnwindSafe for TokenManager<S, C, E>
impl<S, C, E> Send for TokenManager<S, C, E>
impl<S, C, E> Sync for TokenManager<S, C, E>
impl<S, C, E> Unpin for TokenManager<S, C, E>
impl<S, C, E> UnsafeUnpin for TokenManager<S, C, E>
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