teamy-figue 2.0.2

Type-safe CLI arguments, config files, and environment variables powered by Facet reflection
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use facet::Facet;
use std::path::PathBuf;

fn main() {
    let shape = PathBuf::SHAPE;
    println!("PathBuf shape: {:?}", shape.type_identifier);
    println!("PathBuf has_display: {:?}", shape.vtable.has_display());
    println!("PathBuf has_debug: {:?}", shape.vtable.has_debug());

    let p = PathBuf::from("/tmp/test.log");
    match facet_json::to_string(&p) {
        Ok(s) => println!("Serialized PathBuf: {}", s),
        Err(e) => println!("Failed to serialize PathBuf: {:?}", e),
    }
}