pub fn init_plugins() -> Result<()>Expand description
Initialize the plugin system
Scans all compile-time registered plugins from the COMPRESSION_ALGORITHMS
distributed slice, validates their metadata, and registers them in the runtime registry.
§Behavior
- Can be called multiple times (re-initialization clears and re-scans)
- Detects duplicate magic numbers and logs warnings
- Validates plugin metadata (non-empty names, valid performance metrics)
- Thread-safe via
RwLock
§Errors
Returns an error if:
- A plugin has invalid metadata (empty name/version, invalid performance metrics)
- Lock acquisition fails (should never happen in single-threaded tests)
§Examples
use crush_core::init_plugins;
init_plugins().expect("Failed to initialize plugins");