PersistentStorage

Trait PersistentStorage 

Source
pub trait PersistentStorage:
    Send
    + Sync
    + Debug
    + 'static {
    // Required methods
    fn append_message<'life0, 'life1, 'async_trait>(
        &'life0 self,
        topic_name: &'life1 str,
        msg: StreamMessage,
    ) -> Pin<Box<dyn Future<Output = Result<u64, PersistentStorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn create_reader<'life0, 'life1, 'async_trait>(
        &'life0 self,
        topic_name: &'life1 str,
        start: StartPosition,
    ) -> Pin<Box<dyn Future<Output = Result<TopicStream, PersistentStorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn ack_checkpoint<'life0, 'life1, 'async_trait>(
        &'life0 self,
        topic_name: &'life1 str,
        up_to_offset: u64,
    ) -> Pin<Box<dyn Future<Output = Result<(), PersistentStorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn flush<'life0, 'life1, 'async_trait>(
        &'life0 self,
        topic_name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), PersistentStorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A persistent storage interface for a topic.

Required Methods§

Source

fn append_message<'life0, 'life1, 'async_trait>( &'life0 self, topic_name: &'life1 str, msg: StreamMessage, ) -> Pin<Box<dyn Future<Output = Result<u64, PersistentStorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Append a message to a topic and return the assigned offset.

Source

fn create_reader<'life0, 'life1, 'async_trait>( &'life0 self, topic_name: &'life1 str, start: StartPosition, ) -> Pin<Box<dyn Future<Output = Result<TopicStream, PersistentStorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create a streaming reader starting from the provided position.

Source

fn ack_checkpoint<'life0, 'life1, 'async_trait>( &'life0 self, topic_name: &'life1 str, up_to_offset: u64, ) -> Pin<Box<dyn Future<Output = Result<(), PersistentStorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Acknowledge internal checkpoints (used by background uploader/compactor).

Source

fn flush<'life0, 'life1, 'async_trait>( &'life0 self, topic_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), PersistentStorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Optionally force a flush of buffered data.

Implementors§