Skip to main content

Crate geez

Crate geez 

Source
Expand description

geez โ€” Global Error Embedding Zero-cost.

Declarative error enums with thiserror-like attributes. Zero dependencies. Pure macro_rules!.

use geez::geez;

geez! {
    pub enum AppError {
        #[from]
        Io(std::io::Error),

        #[error("bad status {0}")]
        Status(u16),

        NotFound => "not found",
    }
}

fn open_config() -> Result<()> {
    std::fs::File::open("missing.txt")?;
    Ok(())
}

Macrosยง

geez
Build an error enum with Display, Error, optional From impls, and a Result alias.