5 releases

0.0.5 Jul 22, 2021
0.0.4 Jul 22, 2021
0.0.3 Jul 21, 2021
0.0.2 Jul 21, 2021
0.0.1 Jul 19, 2021

#35 in #thrift

Download history 3/week @ 2024-02-26 1/week @ 2024-03-11 76/week @ 2024-04-01

77 downloads per month

MIT license

63KB
2K SLoC

Thrift Parser

Yet another thrift parser powered by nom.

Example

use std::str::FromStr;

use thrift_parser::Parser;

fn main() {
    let mut idl_path =
        std::path::PathBuf::from_str(&std::env::var("CARGO_MANIFEST_DIR").unwrap()).unwrap();
    idl_path.extend(vec!["thrift", "demo.thrift"]);
    let idl = std::fs::read_to_string(idl_path).unwrap();
    let (remains, document) = thrift_parser::document::Document::parse(&idl).unwrap();
    println!("Parser remains: {:?}, document: {:?}", remains, document);
}

Dependencies

~4MB
~88K SLoC