vtx-protocol
Official WIT interface definitions for VTX Project plugins.
This crate serves as the Single Source of Truth (SSOT) for the VTX plugin interface. It embeds the vtx.wit definition directly into your compiled binary or build process, eliminating the need to manually copy or manage .wit files.
Installation
Add this to your Cargo.toml:
[]
= "1.2.0"
= "0.25.0" # Ensure compatibility with the WIT version
Usage
Using with wit-bindgen
Instead of pointing wit-bindgen to a local file path, you can use the exported WIT_CONTENT constant. This ensures your plugin is always built against the exact version of the protocol defined in Cargo.toml.
use WIT_CONTENT;
generate!;
;
export!;
Accessing Raw Files (Advanced)
If you need the physical path to the WIT file (e.g., for build scripts), use the helper function:
// Returns the PathBuf to the bundled vtx.wit file
let wit_path = get_wit_path;
Versioning
This crate follows Semantic Versioning.
Major.Minor.Patchcorresponds strictly to the version of thevtx:apiinterface.