pub struct FileStore { /* private fields */ }Expand description
Persists broker records to a JSON file after each mutation.
Implementations§
Trait Implementations§
Source§impl BrokerStore for FileStore
impl BrokerStore for FileStore
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.
Auto Trait Implementations§
impl Freeze for FileStore
impl !RefUnwindSafe for FileStore
impl Send for FileStore
impl Sync for FileStore
impl Unpin for FileStore
impl !UnwindSafe for FileStore
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