pub mod cid;
pub mod entry;
pub mod hashid;
pub mod id;
pub mod ident;
pub mod optional_id;
pub mod record;
pub mod uid;

#[cfg(feature = "std")]
use thiserror::Error;

#[cfg_attr(feature = "std", derive(Error, Debug))]
pub enum ArmourError {
    #[cfg_attr(feature = "std", error("from bytes error"))]
    FromBytesError,
    #[cfg_attr(feature = "std", error("bytes len error"))]
    BytesLenError,
    #[cfg_attr(feature = "std", error("NonZero is 0"))]
    NonZeroError,
    #[cfg_attr(feature = "std", error("zbase decode error"))]
    ZBaseDecodeError,
    #[cfg_attr(feature = "std", error("unknown error"))]
    UnknownError,
    #[cfg(feature = "std")]
    #[cfg_attr(feature = "std", error(transparent))]
    OtherError(#[from] anyhow::Error),
}

pub type Result<T, E = ArmourError> = core::result::Result<T, E>;
