26 releases (16 breaking)
Uses new Rust 2024
new 0.17.0 | Apr 10, 2025 |
---|---|
0.15.0 | Apr 4, 2025 |
0.14.0 | Mar 4, 2025 |
0.12.2 | Dec 13, 2024 |
0.4.0 | Jul 26, 2024 |
#130 in FFI
499 downloads per month
Used in 4 crates
(3 directly)
690KB
16K
SLoC
Ristretto ClassFile
Getting Started
Implementation of the JVM Class File Format that is used to read, write and verify Java classes.
Supports reading and writing class files for any version of Java version up to 24. Verification of class files is supported, but is still a work in progress.
Examples
use ristretto_classfile::{ClassFile, ConstantPool, Result, Version};
fn main() -> Result<()> {
let mut constant_pool = ConstantPool::default();
let this_class = constant_pool.add_class("Foo")?;
let class_file = ClassFile {
version: Version::Java21 { minor: 0 },
constant_pool,
this_class,
..Default::default()
};
class_file.verify()
}
Safety
This crate uses #![forbid(unsafe_code)]
to ensure everything is implemented in 100% safe Rust.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Dependencies
~1.1–1.8MB
~35K SLoC