rivven-core 0.0.21

Core library for Rivven distributed event streaming platform
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/// Storage backend trait for persistence
pub trait StorageBackend: Send + Sync {
    /// Store a message
    fn store(&self, topic: &str, partition: u32, offset: u64, data: &[u8]) -> crate::Result<()>;

    /// Retrieve messages
    fn retrieve(
        &self,
        topic: &str,
        partition: u32,
        start_offset: u64,
        max_messages: usize,
    ) -> crate::Result<Vec<(u64, Vec<u8>)>>;

    /// Delete messages before offset
    fn trim(&self, topic: &str, partition: u32, before_offset: u64) -> crate::Result<()>;
}