This guide keeps the API and docs consistent and easy to use.
- Prefer
use jvmti_bindings::prelude::*;in examples and docs. - Use
envfor safe wrappers andsysonly for raw FFI types. - Avoid importing
sysin casual examples unless required.
- Keep public APIs small and focused.
- Return owned Rust types instead of raw JVMTI structs.
- Avoid
unwrap()in any code path reachable from callbacks. - Prefer
Result<T, jvmtiError>for JVMTI operations. - Add doc comments explaining safety assumptions when needed.
- Examples should compile as
cdylibagents. - Show capability request, callback registration, and event enablement.
- Mention thread-local
JNIEnvconstraints in any example using JNI.
- Advanced helpers must be behind feature flags.
- Document any feature-gated behavior in README and docs.