pub struct MemoryStore(/* private fields */);Expand description
Thread-safe storage backend that keeps records in-process for tests and demos.
Trait Implementations§
Source§impl BrokerStore for MemoryStore
impl BrokerStore for MemoryStore
Source§fn save(&self, record: TokenRecord) -> StoreFuture<'_, ()>
fn save(&self, record: TokenRecord) -> StoreFuture<'_, ()>
Persists or replaces a token record for the provided family + scope.
Source§fn fetch<'a>(
&'a self,
family: &'a TokenFamily,
scope: &'a ScopeSet,
) -> StoreFuture<'a, Option<TokenRecord>>
fn fetch<'a>( &'a self, family: &'a TokenFamily, scope: &'a ScopeSet, ) -> StoreFuture<'a, Option<TokenRecord>>
Fetches the record associated with the family + scope, if present.
Source§fn compare_and_swap_refresh<'a>(
&'a self,
family: &'a TokenFamily,
scope: &'a ScopeSet,
expected_refresh: Option<&'a str>,
replacement: TokenRecord,
) -> StoreFuture<'a, CompareAndSwapOutcome>
fn compare_and_swap_refresh<'a>( &'a self, family: &'a TokenFamily, scope: &'a ScopeSet, expected_refresh: Option<&'a str>, replacement: TokenRecord, ) -> StoreFuture<'a, CompareAndSwapOutcome>
Atomically rotates a refresh token if the expected secret matches.
Source§fn revoke<'a>(
&'a self,
family: &'a TokenFamily,
scope: &'a ScopeSet,
instant: OffsetDateTime,
) -> StoreFuture<'a, Option<TokenRecord>>
fn revoke<'a>( &'a self, family: &'a TokenFamily, scope: &'a ScopeSet, instant: OffsetDateTime, ) -> StoreFuture<'a, Option<TokenRecord>>
Marks a record as revoked at the provided instant.
Source§impl Clone for MemoryStore
impl Clone for MemoryStore
Source§fn clone(&self) -> MemoryStore
fn clone(&self) -> MemoryStore
Returns a duplicate of the value. Read more
1.0.0 · 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 MemoryStore
impl Debug for MemoryStore
Source§impl Default for MemoryStore
impl Default for MemoryStore
Source§fn default() -> MemoryStore
fn default() -> MemoryStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MemoryStore
impl !RefUnwindSafe for MemoryStore
impl Send for MemoryStore
impl Sync for MemoryStore
impl Unpin for MemoryStore
impl !UnwindSafe for MemoryStore
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