pub trait HandleStore: Send + Sync {
// Required methods
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 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 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 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 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 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 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;
}Expand description
Backend-agnostic durable/persistent handle registry.
Implementations must make reclaim atomic so two
nodes cannot both win the same handle during failover.
Required Methods§
Sourcefn 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).
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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).
Sourcefn 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.
Sourcefn 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,
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).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".