pub struct PluginMetadata {
pub name: String,
pub version: String,
pub description: String,
pub author: String,
pub homepage: Option<String>,
pub api_version: String,
pub min_scarab_version: String,
pub emoji: Option<String>,
pub color: Option<String>,
pub catchphrase: Option<String>,
}Expand description
Plugin metadata with personality
Fields§
§name: StringPlugin name (must be unique)
version: StringPlugin version (semver)
description: StringShort description
Author name
homepage: Option<String>Homepage URL
api_version: StringAPI version this plugin was built against
min_scarab_version: StringMinimum Scarab version required
emoji: Option<String>Plugin emoji/icon for visual identification
color: Option<String>Plugin theme color (hex code)
catchphrase: Option<String>Plugin catchphrase or motto
Implementations§
Source§impl PluginMetadata
impl PluginMetadata
Sourcepub fn new(
name: impl Into<String>,
version: impl Into<String>,
description: impl Into<String>,
author: impl Into<String>,
) -> Self
pub fn new( name: impl Into<String>, version: impl Into<String>, description: impl Into<String>, author: impl Into<String>, ) -> Self
Create new plugin metadata
Sourcepub fn with_homepage(self, homepage: impl Into<String>) -> Self
pub fn with_homepage(self, homepage: impl Into<String>) -> Self
Set homepage URL
Sourcepub fn with_api_version(self, version: impl Into<String>) -> Self
pub fn with_api_version(self, version: impl Into<String>) -> Self
Set API version
Sourcepub fn with_min_scarab_version(self, version: impl Into<String>) -> Self
pub fn with_min_scarab_version(self, version: impl Into<String>) -> Self
Set minimum Scarab version
Sourcepub fn with_emoji(self, emoji: impl Into<String>) -> Self
pub fn with_emoji(self, emoji: impl Into<String>) -> Self
Set plugin emoji for visual flair
Sourcepub fn with_color(self, color: impl Into<String>) -> Self
pub fn with_color(self, color: impl Into<String>) -> Self
Set plugin theme color (hex code like “#FF5733”)
Sourcepub fn with_catchphrase(self, catchphrase: impl Into<String>) -> Self
pub fn with_catchphrase(self, catchphrase: impl Into<String>) -> Self
Set plugin catchphrase or motto
Sourcepub fn display_name(&self) -> String
pub fn display_name(&self) -> String
Get display name with emoji if available
Sourcepub fn is_compatible(&self, current_api_version: &str) -> bool
pub fn is_compatible(&self, current_api_version: &str) -> bool
Check if this plugin is compatible with the current API version
Trait Implementations§
Source§impl Clone for PluginMetadata
impl Clone for PluginMetadata
Source§fn clone(&self) -> PluginMetadata
fn clone(&self) -> PluginMetadata
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 moreAuto Trait Implementations§
impl Freeze for PluginMetadata
impl RefUnwindSafe for PluginMetadata
impl Send for PluginMetadata
impl Sync for PluginMetadata
impl Unpin for PluginMetadata
impl UnsafeUnpin for PluginMetadata
impl UnwindSafe for PluginMetadata
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.