qimen-core 0.2.0

Typed, deterministic time-based Chai Bu rotating Qimen Dunjia charts
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Print the canonical JSON schemas: `cargo run -p qimen-core --example schema
//! --features schema -- request` (or `chart`).

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let kind = std::env::args()
        .nth(1)
        .unwrap_or_else(|| "chart".to_owned());
    let schema = match kind.as_str() {
        "request" => qimen_core::request_schema(),
        "chart" => qimen_core::chart_schema(),
        _ => return Err("expected one argument: request or chart".into()),
    };
    println!("{}", serde_json::to_string_pretty(&schema)?);
    Ok(())
}