| Crates.io | rico_parser |
| lib.rs | rico_parser |
| version | 0.1.1 |
| created_at | 2024-12-26 07:59:14.006811+00 |
| updated_at | 2024-12-26 10:24:46.939002+00 |
| description | A high-performance Apache Thrift IDL parser that converts Thrift IDL files to JSON AST |
| homepage | |
| repository | https://github.com/xxnmeet/rico |
| max_upload_size | |
| id | 1495505 |
| size | 59,455 |
A high-performance Apache Thrift IDL parser written in Rust that converts Thrift IDL files to JSON AST.
[dependencies]
rico_parser = "0.1.0"
use rico_parser::Parser;
fn main() {
let input = r#"
namespace rs demo
struct User {
1: string name
2: i32 age
}
"#;
let mut parser = Parser::new(input);
match parser.parse() {
Ok(ast) => println!("{}", serde_json::to_string_pretty(&ast).unwrap()),
Err(e) => eprintln!("Error: {}", e),
}
}
The project includes a CLI tool for processing multiple Thrift files:
cargo run -p thrift-scan -- --path ./thrift/files --output ./json/output
Run benchmarks on Thrift files:
cargo run -p thrift-benchmark
lib/: Core parser libraryscan/: CLI tool for batch processingbenchmark/: Performance benchmarking toolcargo build --workspace
cargo test --workspace
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.