45 releases (15 breaking)

Uses new Rust 2024

new 0.19.7 May 24, 2025
0.18.9 May 10, 2025

#139 in Command-line interface

Download history 195/week @ 2025-04-04 1168/week @ 2025-04-11 1148/week @ 2025-04-18 649/week @ 2025-04-25 274/week @ 2025-05-02 967/week @ 2025-05-09 497/week @ 2025-05-16

2,451 downloads per month

MIT/Apache

765KB
15K SLoC

Facet logo - a reflection library for Rust

Coverage Status free of syn crates.io documentation MIT/Apache-2.0 licensed

Logo by Misiasart

Thanks to all individual and corporate sponsors, without whom this work could not exist:

Ko-fi GitHub Sponsors Patreon Zed Depot

Provides CLI argument parsing (WIP).

use facet_pretty::FacetPretty;
use facet::Facet;

#[derive(Facet)]
struct Args {
    #[facet(positional)]
    path: String,

    #[facet(named, short = 'v')]
    verbose: bool,

    #[facet(named, short = 'j')]
    concurrency: usize,
}

# fn main() -> Result<(), Box<dyn std::error::Error>> {
let args: Args = facet_args::from_slice(&["--verbose", "-j", "14", "example.rs"])?;
eprintln!("args: {}", args.pretty());
Ok(())
# }

License

Licensed under either of:

at your option.

Dependencies

~390KB