Skip to main content

MessageStore

Trait MessageStore 

Source
pub trait MessageStore: Send {
    // Required methods
    fn next_sender_seq_num(&self) -> u64;
    fn next_target_seq_num(&self) -> u64;
    fn incr_next_sender_seq_num<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn incr_next_target_seq_num<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set_next_sender_seq_num<'life0, 'async_trait>(
        &'life0 mut self,
        n: u64,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set_next_target_seq_num<'life0, 'async_trait>(
        &'life0 mut self,
        n: u64,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn creation_time(&self) -> DateTime<Utc>;
    fn save_message<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        seq_num: u64,
        raw: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_messages<'life0, 'async_trait>(
        &'life0 mut self,
        begin: u64,
        end: u64,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(u64, Vec<u8>)>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn refresh<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn reset<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn save_message_and_incr<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        seq_num: u64,
        raw: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}

Required Methods§

Source

fn next_sender_seq_num(&self) -> u64

Source

fn next_target_seq_num(&self) -> u64

Source

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

Source

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

Source

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

Source

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

Source

fn creation_time(&self) -> DateTime<Utc>

Source

fn save_message<'life0, 'life1, 'async_trait>( &'life0 mut self, seq_num: u64, raw: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Persist an outgoing message under its seqnum.

Source

fn get_messages<'life0, 'async_trait>( &'life0 mut self, begin: u64, end: u64, ) -> Pin<Box<dyn Future<Output = Result<Vec<(u64, Vec<u8>)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Stored messages in [begin, end] as (seq_num, raw) pairs, ascending. Missing seqnums are simply absent (the session layer gap-fills them).

Source

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

Reload state from the backing medium (RefreshOnLogon).

Source

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

Wipe messages, reset both seqnums to 1, restamp creation time.

Provided Methods§

Source

fn save_message_and_incr<'life0, 'life1, 'async_trait>( &'life0 mut self, seq_num: u64, raw: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Persist and advance the sender seqnum as one operation.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§