herolib_otoml 0.3.13

OTOML - Canonical TOML serialization format with compact binary representation.
Documentation
//! Error types for OTOML operations.

use thiserror::Error;

/// Result type alias for OTOML operations.
pub type Result<T> = std::result::Result<T, OtomlError>;

/// Errors that can occur during OTOML serialization or deserialization.
#[derive(Error, Debug)]
pub enum OtomlError {
    /// Error parsing TOML input.
    #[error("TOML parse error: {0}")]
    ParseError(#[from] toml::de::Error),

    /// Error serializing to TOML.
    #[error("TOML serialization error: {0}")]
    SerializeError(#[from] toml::ser::Error),

    /// Invalid datetime format.
    #[error("Invalid datetime format: expected 'YYYY-MM-DD HH:MM:SS', got '{0}'")]
    InvalidDatetime(String),

    /// Invalid otime value.
    #[error("Invalid time: {0}")]
    InvalidTime(String),

    /// Invalid ocur (currency) value.
    #[error("Invalid currency: {0}")]
    InvalidCurrency(String),

    /// Invalid olocation (geographic location) value.
    #[error("Invalid location: {0}")]
    InvalidLocation(String),

    /// Invalid oaddress (civic address) value.
    #[error("Invalid address: {0}")]
    InvalidAddress(String),

    /// Binary serialization error.
    #[error("Binary serialization error: {0}")]
    BinarySerialize(String),

    /// Binary deserialization error.
    #[error("Binary deserialization error: {0}")]
    BinaryDeserialize(String),

    /// Invalid OTOML format (missing prefix or malformed).
    #[error("Invalid OTOML format: {0}")]
    InvalidFormat(String),

    /// JSON serialization error.
    #[error("JSON serialization error: {0}")]
    JsonSerialize(String),

    /// JSON deserialization error.
    #[error("JSON deserialization error: {0}")]
    JsonDeserialize(String),
}