pub struct MemoryCodeStore { /* private fields */ }Expand description
Codes held in this process’s memory.
Implementations§
Source§impl MemoryCodeStore
impl MemoryCodeStore
pub fn new() -> MemoryCodeStore
Sourcepub fn with_retention(retention: u64) -> MemoryCodeStore
pub fn with_retention(retention: u64) -> MemoryCodeStore
How long a spent code is kept for replay detection. Shortening this shortens the window in which a stolen code’s replay is noticed.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl CodeStore for MemoryCodeStore
impl CodeStore for MemoryCodeStore
fn store<'a>(&'a self, code: AuthorizationCode) -> StoreFuture<'a, ()>
Source§fn consume<'a>(
&'a self,
hash: &'a str,
family: &'a str,
now: u64,
) -> StoreFuture<'a, Consumption>
fn consume<'a>( &'a self, hash: &'a str, family: &'a str, now: u64, ) -> StoreFuture<'a, Consumption>
Spend a code, exactly once. Read more
Source§impl Default for MemoryCodeStore
impl Default for MemoryCodeStore
Source§fn default() -> MemoryCodeStore
fn default() -> MemoryCodeStore
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for MemoryCodeStore
impl RefUnwindSafe for MemoryCodeStore
impl Send for MemoryCodeStore
impl Sync for MemoryCodeStore
impl Unpin for MemoryCodeStore
impl UnsafeUnpin for MemoryCodeStore
impl UnwindSafe for MemoryCodeStore
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