pub mod filesystem; pub mod memory; use async_trait::async_trait; use bytes::Bytes; use thiserror::Error; #[derive(Debug, Error)] pub enum SegmentStoreError { #[error("segment not found: {0}")] NotFound(String), #[error("io error: {0}")] Io(#[from] std::io::Error), } pub type SegmentStoreResult = Result; #[async_trait] pub trait SegmentStore: Send + Sync { async fn write_segment(&self, channel_id: &str, name: &str, data: Bytes) -> SegmentStoreResult<()>; async fn read_segment(&self, channel_id: &str, name: &str) -> SegmentStoreResult; async fn list_segments(&self, channel_id: &str) -> SegmentStoreResult>; async fn delete_segment(&self, channel_id: &str, name: &str) -> SegmentStoreResult<()>; }