pub struct MemoryTokenStore { /* private fields */ }Expand description
An ephemeral in-memory TokenStore — a reference adapter and test double.
Not durable: the token lives only for the process lifetime. Real clients plug a persistent keystore (Keychain, encrypted DB column). Useful for a short-lived CLI invocation or a consumer’s tests.
Implementations§
Trait Implementations§
Source§impl Debug for MemoryTokenStore
impl Debug for MemoryTokenStore
Source§impl Default for MemoryTokenStore
impl Default for MemoryTokenStore
Source§fn default() -> MemoryTokenStore
fn default() -> MemoryTokenStore
Returns the “default value” for a type. Read more
Source§impl TokenStore for MemoryTokenStore
impl TokenStore for MemoryTokenStore
Source§fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, TokenStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, TokenStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The currently-persisted refresh token, or
None if unauthenticated.Source§fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
refresh_token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), TokenStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
refresh_token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), TokenStoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Persist a (freshly-rotated) refresh token, replacing any prior one.
Auto Trait Implementations§
impl !Freeze for MemoryTokenStore
impl RefUnwindSafe for MemoryTokenStore
impl Send for MemoryTokenStore
impl Sync for MemoryTokenStore
impl Unpin for MemoryTokenStore
impl UnsafeUnpin for MemoryTokenStore
impl UnwindSafe for MemoryTokenStore
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