Skip to main content

ConnectionStore

Trait ConnectionStore 

Source
pub trait ConnectionStore: Send + Sync {
    // Required methods
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        fingerprint: &'life1 IdentityFingerprint,
    ) -> Pin<Box<dyn Future<Output = Option<ConnectionInfo>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn save<'life0, 'async_trait>(
        &'life0 mut self,
        connection: ConnectionInfo,
    ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update<'life0, 'async_trait>(
        &'life0 mut self,
        update: ConnectionUpdate,
    ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Vec<ConnectionInfo>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for connection cache storage implementations.

Provides an abstraction for storing and retrieving approved remote connections. Implementations must be thread-safe for use in async contexts.

Required Methods§

Source

fn get<'life0, 'life1, 'async_trait>( &'life0 self, fingerprint: &'life1 IdentityFingerprint, ) -> Pin<Box<dyn Future<Output = Option<ConnectionInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get a connection by fingerprint, returning None if not found.

Source

fn save<'life0, 'async_trait>( &'life0 mut self, connection: ConnectionInfo, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Save a connection (insert or replace).

Source

fn update<'life0, 'async_trait>( &'life0 mut self, update: ConnectionUpdate, ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Update only the last_connected_at timestamp for an existing connection.

Source

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

List all cached connections.

Implementors§