pub struct LiveTokenStrategy { /* private fields */ }Expand description
Live token strategy that wraps the existing TokenManager for full token management
Implementations§
Source§impl LiveTokenStrategy
impl LiveTokenStrategy
Sourcepub async fn new() -> Result<Self, Error>
pub async fn new() -> Result<Self, Error>
Creates a new live token strategy using the global TokenManager instance
§Errors
Returns an error if the TokenManager cannot be initialized
Sourcepub const fn with_token_manager(token_manager: Arc<TokenManager>) -> Self
pub const fn with_token_manager(token_manager: Arc<TokenManager>) -> Self
Creates a new live token strategy with a custom TokenManager
Sourcepub async fn with_config(config: RetryConfig) -> Result<Self, Error>
pub async fn with_config(config: RetryConfig) -> Result<Self, Error>
Creates a live token strategy with custom retry configuration
§Errors
Returns an error if the TokenManager cannot be initialized
Sourcepub async fn for_testing() -> Result<Self, Error>
pub async fn for_testing() -> Result<Self, Error>
Creates a live token strategy optimized for testing
§Errors
Returns an error if the TokenManager cannot be initialized
Trait Implementations§
Source§impl Debug for LiveTokenStrategy
impl Debug for LiveTokenStrategy
Source§impl TokenStrategy for LiveTokenStrategy
impl TokenStrategy for LiveTokenStrategy
Source§fn get_token<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_token<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets a valid authentication token
Source§fn clear_token<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clear_token<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clears stored token (for testing)
Source§fn should_persist(&self) -> bool
fn should_persist(&self) -> bool
Returns whether this strategy should persist tokens
Source§fn strategy_type(&self) -> &'static str
fn strategy_type(&self) -> &'static str
Returns the strategy type for debugging
Auto Trait Implementations§
impl !RefUnwindSafe for LiveTokenStrategy
impl !UnwindSafe for LiveTokenStrategy
impl Freeze for LiveTokenStrategy
impl Send for LiveTokenStrategy
impl Sync for LiveTokenStrategy
impl Unpin for LiveTokenStrategy
impl UnsafeUnpin for LiveTokenStrategy
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