nstreams-core 0.3.1

Generic versioned event stream handler with history replay
Documentation
use thiserror::Error;

#[derive(Debug, Error)]
pub enum Error {
    #[error("namespace {0} is invalid: {1}")]
    InvalidNamespace(String, String),

    #[error("event store error: {0}")]
    Store(String),

    #[error("write queue error: {0}")]
    WriteQueue(String),

    #[error("read stream error: {0}")]
    ReadStream(String),

    #[error("serialization error: {0}")]
    Serialization(String),

    #[error("version gap detected: expected {expected}, got {actual}")]
    VersionGap { expected: u64, actual: u64 },

    #[error("stream population in progress for namespace {0}")]
    PopulationInProgress(String),

    #[error("invalid stream filter: {0}")]
    InvalidFilter(String),

    #[error("{0}")]
    Other(String),
}

pub type Result<T> = std::result::Result<T, Error>;