pub struct MockTokenStrategy { /* private fields */ }Expand description
Mock token strategy for isolated testing without persistence
Implementations§
Source§impl MockTokenStrategy
impl MockTokenStrategy
Sourcepub const fn new(token: String) -> Self
pub const fn new(token: String) -> Self
Creates a new mock token strategy with the provided token
Sourcepub fn with_default_token() -> Self
pub fn with_default_token() -> Self
Creates a mock token strategy with a default test token
Trait Implementations§
Source§impl Clone for MockTokenStrategy
impl Clone for MockTokenStrategy
Source§fn clone(&self) -> MockTokenStrategy
fn clone(&self) -> MockTokenStrategy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MockTokenStrategy
impl Debug for MockTokenStrategy
Source§impl TokenStrategy for MockTokenStrategy
impl TokenStrategy for MockTokenStrategy
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 Freeze for MockTokenStrategy
impl RefUnwindSafe for MockTokenStrategy
impl Send for MockTokenStrategy
impl Sync for MockTokenStrategy
impl Unpin for MockTokenStrategy
impl UnsafeUnpin for MockTokenStrategy
impl UnwindSafe for MockTokenStrategy
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