linkrs-sync 0.1.0

Synchronization primitives for Linkrs
Documentation
use thiserror::Error;

#[cfg(feature = "fulltext")]
use crate::coordinator::CoordinatorError;
#[cfg(feature = "fulltext")]
use linkrs_fulltext::SearchError;

#[derive(Debug, Error)]
pub enum BatchError {
    #[error("Buffer overflow: {0}")]
    BufferOverflow(String),

    #[error("Queue is full")]
    QueueFull,

    #[error("Queue is closed")]
    QueueClosed,

    #[cfg(feature = "fulltext")]
    #[error("Coordinator error: {0}")]
    CoordinatorError(#[from] CoordinatorError),

    #[error("Commit error: {0}")]
    CommitError(String),

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

    #[error("Transaction error: {0}")]
    TransactionError(String),

    #[error("Invalid operation: {0}")]
    InvalidOperation(String),

    #[cfg(feature = "fulltext")]
    #[error("Search engine error: {0}")]
    SearchError(#[from] SearchError),
}

pub type BatchResult<T> = Result<T, BatchError>;