Skip to main content

MemStore

Struct MemStore 

Source
pub struct MemStore { /* private fields */ }
Expand description

In-process, non-durable store — the default single-node/dev backend.

Implementations§

Source§

impl MemStore

Source

pub fn new() -> MemStore

Create an empty in-memory store.

Trait Implementations§

Source§

impl Default for MemStore

Source§

fn default() -> MemStore

Returns the “default value” for a type. Read more
Source§

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,

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,

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,

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,

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,

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,

Drop every non-persistent handle whose deadline has passed; returns the GUIDs removed so the caller can release their backing resources.
Source§

fn list<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<HandleRecord>, StoreError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

All live handle records (diagnostics / reconciliation).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.