fastxdr 1.0.2

Generate Rust types from XDR specs with fast, zero-copy deserialisation
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use fastxdr::Generator;
use fastxdr::Result;
use std::env;

fn main() -> Result<()> {
    if env::args().len() < 2 {
        println!("usage: {} ./path/to/spec.x", env::args().next().unwrap());
        std::process::exit(1);
    }

    for e in env::args().skip(1) {
        let xdr = std::fs::read_to_string(e)?;
        let code = Generator::default().generate(&xdr)?;
        println!("{}", code);
    }

    Ok(())
}