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, vtx_vfs,
17};
18
19/// Error Type Definitions and Unified Error Handling
20pub mod vtx_error;
21
22/// Permission constants and helpers
23pub mod vtx_permissions;
24
25/// Capability declaration builders
26pub mod vtx_capabilities;
27
28/// Common Prelude Module (exports common types/macros/helper functions)
29pub mod prelude;
30
31/// Plugin Export Adapter with Lower Boilerplate
32pub mod plugin;
33
34/// Exports the plugin implementation interface definition (`export!(...)`)
35/// Provides the interface for external plugin usage.
36pub use bindings::export;
37
38/// User Context Structure, commonly used in authorization interfaces
39/// The `UserContext` type is often used for user authentication and permission check context data.
40pub use bindings::vtx::api::vtx_auth_types::UserContext;
41
42/// Plugin Manifest Type, used for plugin metadata management
43/// The `Manifest` type is used to represent plugin metadata and descriptive information.
44pub use bindings::vtx::api::vtx_types::Manifest;
45pub use bindings::vtx::api::vtx_types::{Capabilities, HttpAllowRule};
46
47/// Current User Information (from host context)
48pub use bindings::vtx::api::vtx_auth_types::CurrentUser;
49
50/// Exposes the WIT interface definition content used by the SDK
51/// Directly reuses constants from the `vtx-protocol` crate, with zero runtime overhead.
52#[cfg(feature = "meta")]
53pub const WIT_DEFINITION: &str = vtx_protocol::WIT_CONTENT;
54
55/// SDK Version Number
56#[cfg(feature = "meta")]
57pub const VERSION: &str = env!("CARGO_PKG_VERSION");