Skip to main content

MessageStore

Trait MessageStore 

Source
pub trait MessageStore: Send + Sync {
    // Required methods
    fn store<'life0, 'life1, 'async_trait>(
        &'life0 self,
        seq_num: u64,
        message: &'life1 [u8],
    ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn get_range<'life0, 'async_trait>(
        &'life0 self,
        begin: u64,
        end: u64,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<OwnedMessage>, StoreError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn next_sender_seq(&self) -> u64;
    fn next_target_seq(&self) -> u64;
    fn set_next_sender_seq(&self, seq: u64);
    fn set_next_target_seq(&self, seq: u64);
    fn reset<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn creation_time(&self) -> SystemTime;

    // Provided method
    fn refresh<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait { ... }
}
Expand description

Abstract interface for FIX message storage.

Implementations of this trait provide persistence for outgoing messages to support resend requests and session recovery.

Required Methods§

Source

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

Stores an outgoing message for potential resend.

§Arguments
  • seq_num - The message sequence number
  • message - The raw message bytes
§Errors

Returns StoreError if the message cannot be stored.

Source

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

Retrieves messages for a resend request.

§Arguments
  • begin - Begin sequence number (inclusive)
  • end - End sequence number (inclusive, or 0 for infinity)
§Returns

A vector of messages in the requested range.

§Errors

Returns StoreError if messages cannot be retrieved.

Source

fn next_sender_seq(&self) -> u64

Returns the next sender sequence number.

Source

fn next_target_seq(&self) -> u64

Returns the next expected target sequence number.

Source

fn set_next_sender_seq(&self, seq: u64)

Sets the next sender sequence number.

§Arguments
  • seq - The new sequence number
Source

fn set_next_target_seq(&self, seq: u64)

Sets the next expected target sequence number.

§Arguments
  • seq - The new sequence number
Source

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

Resets the store, clearing all messages and resetting sequence numbers.

§Errors

Returns StoreError if the reset fails.

Source

fn creation_time(&self) -> SystemTime

Returns the creation time of the store/session.

Provided Methods§

Source

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

Refreshes the store from persistent storage.

§Errors

Returns StoreError if the refresh fails.

Implementors§