PluginManifest

Struct PluginManifest 

Source
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: String

Plugin name (unique identifier).

§version: String

Plugin version (semver).

§description: String

Human-readable description.

§author: Option<String>

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: Value

Additional custom configuration.

Implementations§

Source§

impl PluginManifest

Source

pub fn validate(&self) -> Result<()>

Validate the manifest.

§Errors

Returns an error if the manifest is invalid.

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}
Source

pub fn parsed_version(&self) -> Result<Version>

Get the parsed semver version.

§Errors

Returns an error if the version is invalid.

Trait Implementations§

Source§

impl Clone for PluginManifest

Source§

fn clone(&self) -> PluginManifest

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PluginManifest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PluginManifest

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for PluginManifest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,