fabric-rs-codegen 0.2.2

Pure-Rust JVM classfile writer, JAR SDK indexer, Rust binding emitter, and Mixin/Subclass bytecode generator for FLR v2
Documentation
//! Pure-Rust JVM bytecode generator, JAR SDK indexer, and Rust binding emitter for FLR v2.
//!
//! `fabric-rs-codegen` synthesizes verifiable `.class` files (complete with automatic `StackMapTable`
//! frames) without requiring `javac` or Java ASM at package time:
//!
//! - [`jvm_writer`]: Constant pool builder, bytecode instruction emitter (`CodeWriter`), annotations, and `.class` serializer.
//! - [`class_reader`]: Classfile parser for JAR indexing ([`build_sdk_index_from_jars`]) and constant-pool relocation ([`relocate_class_bytes`]).
//! - [`bootstrap_gen`]: Isolated per-mod `FlrLoader.class`, `RustBootstrap.class`, and optional `NativeBridge.class`.
//! - [`mixin_gen`]: SpongePowered Mixin `.class` synthesis, `MixinTrampolines.class`, `*.mixins.json`, and `*.refmap.json`.
//! - [`subclass_gen`]: Custom Java subclass `.class` emission with `flrHandle`, overrides, and `invokespecial` super bridges.
//! - [`rust_emitter`]: Generates typed Rust wrappers ([`emit_rust_binding`]) used by `bind_class!` and `cargo fabric bindings`.

/// Isolated per-mod loader, `RustBootstrap`, and dynamic `NativeBridge` generators.
pub mod bootstrap_gen;
/// JVM `.class` reader, constant-pool class relocator, and JAR SDK indexer.
pub mod class_reader;
/// Pure-Rust JVM classfile writer with basic-block label patching and `StackMapTable` generation.
pub mod jvm_writer;
/// Mixin classfile, trampoline, config, and Intermediary refmap generators.
pub mod mixin_gen;
/// Rust wrapper struct/method code emitter backing `bind_class!` and `cargo fabric bindings`.
pub mod rust_emitter;
/// Custom Java subclass `.class` and `SubclassTrampolines` generators.
pub mod subclass_gen;

pub use bootstrap_gen::{generate_native_bridge, generate_rust_bootstrap, relocate_runtime_loader};
pub use class_reader::{build_sdk_index_from_jars, parse_class_bytes, relocate_class_bytes};
pub use jvm_writer::{
    access_flags, opcodes, Annotation, ClassWriter, CodeWriter, ElementValue, FieldWriter,
    LabelId, MethodWriter, VerificationType,
};
pub use mixin_gen::{generate_mixin_class, generate_mixins_json, generate_refmap_json};
pub use rust_emitter::emit_rust_binding;
pub use subclass_gen::generate_subclass_bytes;