erofs-rs 0.2.1

A pure Rust library for reading EROFS (Enhanced Read-Only File System) images
Documentation
use alloc::string::String;
use thiserror::Error;

#[derive(Debug, Error)]
pub enum Error {
    #[error("invalid super block: {0}")]
    InvalidSuperblock(String),

    #[error("invalid dirent file type: {0}")]
    InvalidDirentFileType(u8),

    #[error("invalid layout: {0}")]
    InvalidLayout(u8),

    #[error("path not found: {0}")]
    PathNotFound(String),

    #[error("not a file: {0}")]
    NotAFile(String),

    #[error("not a directory: {0}")]
    NotADirectory(String),

    #[error("out of bounds: {0}")]
    OutOfBounds(String),

    #[error("binread error: {0}")]
    BinRead(#[from] binrw::Error),

    #[error("out of range {0} of {1}")]
    OutOfRange(usize, usize),

    #[error("{0} not supported yet")]
    NotSupported(String),

    #[error("corrupted data: {0}")]
    CorruptedData(String),

    #[cfg(feature = "std")]
    #[error("I/O error: {0}")]
    Io(#[from] std::io::Error),

    #[cfg(feature = "opendal")]
    #[error("opendal error: {0}")]
    Opendal(#[from] opendal::Error),
}

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