Thanks to visit codestin.com
Credit goes to docs.rs

Skip to main content

Crate ristretto_jimage

Crate ristretto_jimage 

Source
Expand description

§Ristretto JImage

Code Coverage Benchmarks License Semantic Versioning

§Getting Started

JImage is a file format introduced in Java 9 to store Java runtime resources efficiently. This crate provides a reader for JImage files, allowing you to access and manipulate the resources contained within them.

§Examples

use ristretto_jimage::Image;
use std::path::PathBuf;

fn main() -> ristretto_jimage::Result<()> {
    // Typically found at $JAVA_HOME/lib/modules
    let path = PathBuf::from("/path/to/java/lib/modules");
    let image = Image::from_file(&path)?;
    let resource_name = "/java.base/java/lang/Object.class";
    let resource = image.get_resource(resource_name)?;
    assert_eq!(resource_name, resource.full_name());
    Ok(())
}

Structs§

Image
A representation of an Image file.
Resource
A resource entry in the Image file.

Enums§

Error
Errors that can occur while reading an Image file.

Type Aliases§

Result
Image result type