pub struct PluginManifest {Show 13 fields
pub name: String,
pub version: String,
pub description: String,
pub author: Option<String>,
pub homepage: Option<String>,
pub license: Option<String>,
pub min_orbis_version: Option<String>,
pub dependencies: Vec<PluginDependency>,
pub permissions: Vec<PluginPermission>,
pub routes: Vec<PluginRoute>,
pub pages: Vec<PageDefinition>,
pub wasm_entry: Option<String>,
pub config: Value,
}Expand description
Plugin manifest describing the plugin’s metadata, routes, and pages.
Fields§
§name: StringPlugin name (unique identifier).
version: StringPlugin version (semver).
description: StringHuman-readable description.
Plugin author.
homepage: Option<String>Plugin homepage URL.
license: Option<String>Plugin license.
min_orbis_version: Option<String>Minimum Orbis version required.
dependencies: Vec<PluginDependency>Plugin dependencies.
permissions: Vec<PluginPermission>Required permissions.
routes: Vec<PluginRoute>API routes defined by the plugin.
pages: Vec<PageDefinition>UI pages defined by the plugin.
wasm_entry: Option<String>Entry point for WASM plugins (relative path in unpacked/packed).
config: ValueAdditional custom configuration.
Implementations§
Source§impl PluginManifest
impl PluginManifest
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Examples found in repository?
examples/complete_plugin.rs (line 38)
6fn main() {
7 // Create a simple plugin manifest
8 let manifest = PluginManifest {
9 name: "example-plugin".to_string(),
10 version: "1.0.0".to_string(),
11 description: "An example plugin demonstrating the API".to_string(),
12 author: Some("Plugin Developer".to_string()),
13 homepage: Some("https://example.com".to_string()),
14 license: Some("MIT".to_string()),
15 min_orbis_version: Some("0.1.0".to_string()),
16 dependencies: vec![],
17 permissions: vec![
18 PluginPermission::DatabaseRead,
19 PluginPermission::Network,
20 ],
21 routes: vec![
22 PluginRoute {
23 method: "GET".to_string(),
24 path: "/api/data".to_string(),
25 handler: "get_data".to_string(),
26 description: Some("Fetch data from the plugin".to_string()),
27 requires_auth: true,
28 permissions: vec![],
29 rate_limit: Some(60),
30 },
31 ],
32 pages: vec![create_dashboard_page()],
33 wasm_entry: Some("plugin.wasm".to_string()),
34 config: serde_json::json!({}),
35 };
36
37 // Validate the manifest
38 match manifest.validate() {
39 Ok(()) => println!("✓ Manifest is valid"),
40 Err(e) => eprintln!("✗ Manifest validation failed: {}", e),
41 }
42
43 // Serialize to JSON
44 match serde_json::to_string_pretty(&manifest) {
45 Ok(json) => println!("\nManifest JSON:\n{}", json),
46 Err(e) => eprintln!("Failed to serialize manifest: {}", e),
47 }
48}Sourcepub fn parsed_version(&self) -> Result<Version>
pub fn parsed_version(&self) -> Result<Version>
Trait Implementations§
Source§impl Clone for PluginManifest
impl Clone for PluginManifest
Source§fn clone(&self) -> PluginManifest
fn clone(&self) -> PluginManifest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PluginManifest
impl Debug for PluginManifest
Source§impl<'de> Deserialize<'de> for PluginManifest
impl<'de> Deserialize<'de> for PluginManifest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PluginManifest
impl RefUnwindSafe for PluginManifest
impl Send for PluginManifest
impl Sync for PluginManifest
impl Unpin for PluginManifest
impl UnwindSafe for PluginManifest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more