vtx_sdk/lib.rs
1/// WIT Interface Binding Module (Private)
2///
3/// # Description
4/// This module is responsible for generating and managing interface bindings defined by the VTX Protocol.
5/// It no longer depends on local files, but directly uses the single source of truth provided by `vtx-protocol`.
6pub mod bindings {
7 include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
8}
9
10/// Host ABI Wrappers (split by domain for easier maintenance)
11pub mod host;
12
13/// Compatibility Exports: Keeps paths like `vtx_sdk::db/...` unchanged
14pub use host::{
15 vtx_auth, vtx_context, vtx_db, vtx_event_bus, vtx_events, vtx_ffmpeg, vtx_http,
16 vtx_http_client, vtx_stream,
17};
18
19/// Error Type Definitions and Unified Error Handling
20pub mod vtx_error;
21
22/// Common Prelude Module (exports common types/macros/helper functions)
23pub mod prelude;
24
25/// Plugin Export Adapter with Lower Boilerplate
26pub mod plugin;
27
28/// Exports the plugin implementation interface definition (`export!(...)`)
29/// Provides the interface for external plugin usage.
30pub use bindings::export;
31
32/// User Context Structure, commonly used in authorization interfaces
33/// The `UserContext` type is often used for user authentication and permission check context data.
34pub use bindings::vtx::api::vtx_auth_types::UserContext;
35
36/// Plugin Manifest Type, used for plugin metadata management
37/// The `Manifest` type is used to represent plugin metadata and descriptive information.
38pub use bindings::vtx::api::vtx_types::Manifest;
39pub use bindings::vtx::api::vtx_types::{Capabilities, HttpAllowRule};
40
41/// Current User Information (from host context)
42pub use bindings::vtx::api::vtx_auth_types::CurrentUser;
43
44/// Exposes the WIT interface definition content used by the SDK
45/// Directly reuses constants from the `vtx-protocol` crate, with zero runtime overhead.
46#[cfg(feature = "meta")]
47pub const WIT_DEFINITION: &str = vtx_protocol::WIT_CONTENT;
48
49/// SDK Version Number
50#[cfg(feature = "meta")]
51pub const VERSION: &str = env!("CARGO_PKG_VERSION");