Expand description
Orbis Plugin API
This crate provides the core types and traits needed to develop plugins for Orbis. It includes:
- SDK: Complete plugin development kit with minimal boilerplate
- UI schema types: Declarative interface definitions
- Plugin manifest: Metadata and configuration structures
- Runtime host functions: WASM plugin host interface
- Error handling: Plugin-specific error types
This is the only crate plugin developers need to depend on.
§Quick Start
ⓘ
use orbis_plugin_api::prelude::*;
// Define your plugin with zero boilerplate
orbis_plugin! {
init: || {
log::info!("Plugin initialized!");
Ok(())
}
}
// Create a handler
#[handler]
fn my_handler(ctx: Context) -> Result<Response> {
let count = state::increment("visits")?;
Response::json(&json!({ "visits": count }))
}Re-exports§
pub use error::Error;pub use error::Result;pub use manifest::PluginDependency;pub use manifest::PluginManifest;pub use manifest::PluginPermission;pub use manifest::PluginRoute;pub use runtime::HostFunctions;pub use runtime::LogLevel;pub use runtime::PluginContext;pub use ui::AccordionItem;pub use ui::Action;pub use ui::ArgMapping;pub use ui::BreadcrumbItem;pub use ui::ComponentSchema;pub use ui::CustomValidation;pub use ui::DialogDefinition;pub use ui::EventHandlers;pub use ui::FormField;pub use ui::PageDefinition;pub use ui::PageLifecycleHooks;pub use ui::SelectOption;pub use ui::StateFieldDefinition;pub use ui::StateFieldType;pub use ui::TabItem;pub use ui::TableColumn;pub use ui::ToastLevel;pub use ui::ValidationRule;
Modules§
- error
- Error types for plugin development.
- manifest
- Plugin manifest definition.
- prelude
- Prelude for convenient imports in plugins
- runtime
- Runtime host functions available to plugins.
- sdk
- Orbis Plugin SDK
- ui
- Enhanced UI component and page definitions for JSON-described GUI.
Macros§
- log_
debug - Log a debug message
- log_
error - Log an error message
- log_
info - Log an info message
- log_
trace - Log a trace message
- log_
warn - Log a warning message
- orbis_
allocators - Define memory allocation functions for the plugin
- orbis_
plugin - Define a complete plugin with minimal boilerplate
- wrap_
handler - Wraps a handler function to handle FFI details automatically