pub struct MemoryTokenStorage { /* private fields */ }Expand description
In-memory token storage (no persistence).
Stores the authentication token in memory only. The token is lost when the application exits. This is useful for:
- Testing
- Mobile platforms that use custom secure storage
- Applications that don’t need token persistence
§Examples
use edgefirst_client::{MemoryTokenStorage, TokenStorage};
let storage = MemoryTokenStorage::new();
storage.store("my-token").unwrap();
assert_eq!(storage.load().unwrap(), Some("my-token".to_string()));
storage.clear().unwrap();
assert_eq!(storage.load().unwrap(), None);Implementations§
Trait Implementations§
Source§impl Debug for MemoryTokenStorage
impl Debug for MemoryTokenStorage
Source§impl Default for MemoryTokenStorage
impl Default for MemoryTokenStorage
Source§fn default() -> MemoryTokenStorage
fn default() -> MemoryTokenStorage
Returns the “default value” for a type. Read more
Source§impl TokenStorage for MemoryTokenStorage
impl TokenStorage for MemoryTokenStorage
Auto Trait Implementations§
impl !Freeze for MemoryTokenStorage
impl RefUnwindSafe for MemoryTokenStorage
impl Send for MemoryTokenStorage
impl Sync for MemoryTokenStorage
impl Unpin for MemoryTokenStorage
impl UnwindSafe for MemoryTokenStorage
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more