Skip to main content

PskStore

Trait PskStore 

Source
pub trait PskStore: Send + Sync {
    // Required methods
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        psk_id: &'life1 PskId,
    ) -> Pin<Box<dyn Future<Output = Option<PskEntry>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn save<'life0, 'async_trait>(
        &'life0 mut self,
        entry: PskEntry,
    ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn remove<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        psk_id: &'life1 PskId,
    ) -> Pin<Box<dyn Future<Output = Result<(), ClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Vec<PskEntry>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Persistent storage for reusable pre-shared keys.

Unlike ephemeral PSK pairings (which are consumed on first use), entries in a PskStore survive across connections and restarts. Used for automation scenarios where a remote client needs to connect repeatedly with the same PSK token.

Required Methods§

Source

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

Get a PSK entry by its identifier.

Source

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

Save a PSK entry (insert or replace).

Source

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

Remove a PSK entry by its identifier.

Source

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

List all stored PSK entries.

Implementors§