Skip to main content

ConfigPlugin

Struct ConfigPlugin 

Source
pub struct ConfigPlugin { /* private fields */ }
Expand description

A plugin loaded from a config file.

Implementations§

Source§

impl ConfigPlugin

Source

pub fn load(path: &Path) -> PluginResult<Self>

Load a plugin from a TOML file.

Source

pub fn manifest(&self) -> &PluginManifest

Get the plugin manifest.

Trait Implementations§

Source§

impl Plugin for ConfigPlugin

Source§

fn name(&self) -> &'static str

Returns the unique name of the plugin. Read more
Source§

fn version(&self) -> &'static str

Returns the version of the plugin (semver format).
Source§

fn description(&self) -> &'static str

Returns a human-readable description of the plugin.
Source§

fn capabilities(&self) -> PluginCapabilities

Returns the capabilities this plugin provides.
Source§

fn min_editor_version(&self) -> Option<&'static str>

Returns the minimum editor version required.
Source§

fn init(&mut self, _ctx: &PluginContext) -> PluginResult<()>

Initialize the plugin with the given context. Read more
Source§

fn activate(&mut self, _ctx: &PluginContext) -> PluginResult<()>

Activate the plugin. Read more
Source§

fn deactivate(&mut self, _ctx: &PluginContext) -> PluginResult<()>

Deactivate the plugin. Read more
Source§

fn commands(&self) -> Vec<CommandConfig>

Returns the commands this plugin provides.
Source§

fn keybindings(&self) -> Vec<KeybindingConfig>

Returns the keybindings this plugin provides.
Source§

fn execute_command( &mut self, command: &str, args: &str, ctx: &PluginContext, ) -> bool

Execute a command provided by this plugin. Read more
Source§

fn as_any(&self) -> &dyn Any

Get a reference to self as Any (for downcasting).
Source§

fn as_any_mut(&mut self) -> &mut dyn Any

Get a mutable reference to self as Any (for downcasting).
Source§

fn dependencies(&self) -> &[&'static str]

Returns names of plugins this plugin depends on.
Source§

fn pane_types(&self) -> Vec<PaneConfig>

Returns the pane types this plugin provides.
Source§

fn themes(&self) -> Vec<ThemeDefinition>

Returns the custom themes this plugin provides. Read more
Source§

fn custom_table_panes(&self) -> Vec<CustomTableConfig>

Returns the custom table pane types this plugin provides. Read more
Source§

fn custom_chart_panes(&self) -> Vec<CustomChartConfig>

Returns the custom chart pane types this plugin provides. Read more
Source§

fn custom_stat_panes(&self) -> Vec<StatPaneConfig>

Returns the custom stat pane types this plugin provides. Read more
Source§

fn custom_gauge_panes(&self) -> Vec<GaugePaneConfig>

Returns the custom gauge pane types this plugin provides. Read more
Source§

fn lifecycle_hooks(&self) -> Option<Box<dyn LifecycleHook>>

Returns the lifecycle hooks this plugin wants to receive.
Source§

fn command_hooks(&self) -> Option<Box<dyn CommandHook>>

Returns the command hooks this plugin wants to receive.
Source§

fn keyboard_hooks(&self) -> Option<Box<dyn KeyboardHook>>

Returns the keyboard hooks this plugin wants to receive.
Source§

fn theme_hooks(&self) -> Option<Box<dyn ThemeHook>>

Returns the theme hooks this plugin wants to receive.
Source§

fn pane_hooks(&self) -> Option<Box<dyn PaneHook>>

Returns the pane hooks this plugin wants to receive.
Source§

fn on_theme_changed(&mut self, _theme: Theme)

Called when the theme changes. Read more
Source§

fn refreshable_pane_types(&self) -> Vec<(&str, u32)>

Get pane types that have auto-refresh enabled. Read more
Source§

fn trigger_pane_refresh( &mut self, _pane_type: &str, _ctx: &PluginContext, ) -> bool

Trigger a refresh for a specific pane type. 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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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> MaybeSend for T
where T: Send,