19 releases (11 breaking)
new 0.12.2 | Dec 13, 2024 |
---|---|
0.12.0 | Nov 29, 2024 |
0.4.0 | Jul 26, 2024 |
#528 in Development tools
567 downloads per month
Used in 3 crates
(2 directly)
600KB
15K
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