pub struct MemoryTokenStore { /* private fields */ }Expand description
Tokens held in this process’s memory.
Everything is lost on restart and nothing is shared between processes, which
makes it right for tests and for cargo run, and wrong for a deployment
where a token issued by one worker must be accepted by another.
Implementations§
Trait Implementations§
Source§impl Debug for MemoryTokenStore
A count, and nothing else.
impl Debug for MemoryTokenStore
A count, and nothing else.
Printing the tokens themselves would put thirty-two digests into whatever log line printed the store.
Source§impl Default for MemoryTokenStore
impl Default for MemoryTokenStore
Source§impl TokenStore for MemoryTokenStore
impl TokenStore for MemoryTokenStore
Source§fn create(&self, token: Token) -> TokenFuture<'_, Token>
fn create(&self, token: Token) -> TokenFuture<'_, Token>
Persist a newly issued token and return it as stored. Read more
Source§fn find<'a>(&'a self, id: &'a str) -> TokenFuture<'a, Option<Token>>
fn find<'a>(&'a self, id: &'a str) -> TokenFuture<'a, Option<Token>>
Load one token by id, or
None when there is no such row. Read moreSource§fn delete<'a>(&'a self, id: &'a str) -> TokenFuture<'a, ()>
fn delete<'a>(&'a self, id: &'a str) -> TokenFuture<'a, ()>
Revoke one token. Deleting an id that is already gone is not an error.
Source§fn delete_for_identity<'a>(
&'a self,
identity: &'a Identity,
) -> TokenFuture<'a, ()>
fn delete_for_identity<'a>( &'a self, identity: &'a Identity, ) -> TokenFuture<'a, ()>
Revoke every token belonging to one user. Read more
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