Hydrust SDK
The official Software Development Kit for building Hydrust WASM plugins.
Hydrust is a high-performance, plugin-based media framework. This SDK allows you to build site-specific logic (URL parsing, metadata extraction, stream discovery) that runs in a secure, sandboxed WebAssembly environment.
Quick Start
- Create a new project.
Plugins must be compiled as WebAssembly components.
- Configure Cargo.toml Set the crate type to cdylib and add the SDK:
[]
= ["cdylib"]
[]
= "0.1.0"
- Implement the Plugin Edit src/lib.rs to handle events from the Hydrust Core:
use ;
use Event;
use PluginInfo;
;
register_plugin!;
🛠 Features Included
- Strongly Typed Events: Full access to the Hydrust WIT protocol.
- HTML Parsing: Includes scraper for efficient DOM manipulation inside WASM.
- JSON Support: serde and serde_json ready for API interaction.
- Sandboxed Execution: Your plugin runs in a secure environment with managed access to the host.
📦 Building your Plugin
To compile your plugin to a WASM component, we recommend using cargo component:
The resulting .wasm file in target/wasm32-wasip1/release/ can be dropped directly into the Hydrust plugins/ directory.
📜 License
Licensed under MIT license.