rypipe-core 0.6.1

Format-agnostic ingestion framework with Arrow export
Documentation
use thiserror::Error;

/// Crate-wide error type.
#[derive(Debug, Error)]
pub enum Error {
    /// Invalid UTF-8 in input bytes.
    #[error("invalid UTF-8: {0}")]
    Utf8(#[from] simdutf8::basic::Utf8Error),

    /// I/O failure (read, seek, mmap, etc.).
    #[error("I/O error: {0}")]
    Io(#[from] std::io::Error),

    /// Invalid or inconsistent execution plan.
    #[error("plan error: {0}")]
    Plan(String),

    /// A strict executor memory allowance was exceeded.
    #[error("memory budget exceeded: {used} bytes used, limit {limit} bytes")]
    Memory { used: usize, limit: usize },

    /// Merge conflict between chunks (e.g. column type mismatch).
    #[error("merge error: {0}")]
    Merge(String),

    /// Arrow array/batch construction failure.
    #[error("Arrow error: {0}")]
    Arrow(#[from] arrow::error::ArrowError),

    /// Parser misbehavior: the parser returned invalid data.
    #[error("parser error: {0}")]
    Parser(String),

    /// Lifetime violation: the parser returned a borrowed value that outlives the input.
    #[error("lifetime error: {0}")]
    Lifetime(String),
}

/// Shorthand result type used throughout the crate.
pub type Result<T> = std::result::Result<T, Error>;