dynpatch-core
Runtime engine for safe live code reloading in Rust.
This crate provides the core functionality for dynamically loading, validating, and activating patches at runtime, with strong safety guarantees and transactional semantics.
Features
- Dynamic library loading: Safe loading of
.so/.dylib/.dllfiles - ABI validation: Strong type and layout compatibility checking
- Transactional activation: All-or-nothing patch application with automatic rollback
- Rollback stack: Maintain history and revert to previous versions
- Lock-free swapping: RCU-like publication using
arc-swap - Metrics: Optional performance and operation metrics
Optional Features
abi_stable: Enhanced ABI compatibility checks using theabi_stablecratemetrics: Enable detailed metrics collectionsigning: Cryptographic signature verification for patchessandbox: Process isolation for untrusted patches
Usage
use ;
// Initialize the runtime
init;
// Load a patch
reload?;
// Check active patch
if let Some = active_patch_info
// Rollback if needed
rollback?;
License
MIT - See LICENSE file for details