9 releases (breaking)
0.7.0 | Aug 20, 2024 |
---|---|
0.6.0 | Aug 15, 2024 |
0.5.0 | Aug 9, 2024 |
0.4.0 | Jul 26, 2024 |
0.1.0 | Jul 9, 2024 |
#654 in Development tools
396 downloads per month
Used in ristretto_classloader
550KB
13K
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
These crates use #![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
~0.4–1MB
~21K SLoC