pub struct MemStore { /* private fields */ }Expand description
In-process, non-durable store — the default single-node/dev backend.
Implementations§
Trait Implementations§
Source§impl HandleStore for MemStore
impl HandleStore for MemStore
Source§fn put<'life0, 'async_trait>(
&'life0 self,
record: HandleRecord,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put<'life0, 'async_trait>(
&'life0 self,
record: HandleRecord,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Insert or replace a handle record (durable grant).
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
create_guid: &'life1 Guid,
) -> Pin<Box<dyn Future<Output = Result<Option<HandleRecord>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
create_guid: &'life1 Guid,
) -> Pin<Box<dyn Future<Output = Result<Option<HandleRecord>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch a handle record by its create GUID.
Source§fn take<'life0, 'life1, 'async_trait>(
&'life0 self,
create_guid: &'life1 Guid,
match_guid: Option<Guid>,
now_ms: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<HandleRecord>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn take<'life0, 'life1, 'async_trait>(
&'life0 self,
create_guid: &'life1 Guid,
match_guid: Option<Guid>,
now_ms: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<HandleRecord>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Atomically validate and remove a handle for a durable reconnect
([MS-SMB2] §3.3.5.9.7): the record must exist, be unexpired, and — when
match_guid is Some (v2 reconnect) — carry the same client guid.
Returns the removed record on success, else None.Source§fn reclaim<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
create_guid: &'life1 Guid,
owner: &'life2 str,
now_ms: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<HandleRecord>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn reclaim<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
create_guid: &'life1 Guid,
owner: &'life2 str,
now_ms: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<HandleRecord>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Atomically claim a handle for
owner when it is free, already owned by
owner, or expired. Returns the (now owned) record, or None if it is
still validly owned by another node. Reclaim renews the deadline.Source§fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
create_guid: &'life1 Guid,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove<'life0, 'life1, 'async_trait>(
&'life0 self,
create_guid: &'life1 Guid,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove a handle record (close or durable expiry).
Source§fn sweep_expired<'life0, 'async_trait>(
&'life0 self,
now_ms: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<Guid>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sweep_expired<'life0, 'async_trait>(
&'life0 self,
now_ms: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<Guid>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Drop every non-persistent handle whose deadline has passed; returns the
GUIDs removed so the caller can release their backing resources.
Auto Trait Implementations§
impl !Freeze for MemStore
impl RefUnwindSafe for MemStore
impl Send for MemStore
impl Sync for MemStore
impl Unpin for MemStore
impl UnsafeUnpin for MemStore
impl UnwindSafe for MemStore
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