pub struct PluginHost {
pub errors: Vec<String>,
/* private fields */
}Expand description
Loads Rhai plugins and runs their commands against the editor.
Fields§
§errors: Vec<String>Errors encountered while loading or running plugins.
Implementations§
Source§impl PluginHost
impl PluginHost
Sourcepub fn add_plugin(&mut self, name: &str, source: &str)
pub fn add_plugin(&mut self, name: &str, source: &str)
Adds (or replaces) a named plugin from source and rebuilds.
Sourcepub fn commands(&self) -> Vec<CommandInfo>
pub fn commands(&self) -> Vec<CommandInfo>
All registered commands, sorted by title.
pub fn command_titles(&self) -> Vec<String>
Sourcepub fn keybindings(&self) -> Vec<(KeySpec, String)>
pub fn keybindings(&self) -> Vec<(KeySpec, String)>
All registered keybindings.
Sourcepub fn lookup_key(&self, key: &KeySpec) -> Option<String>
pub fn lookup_key(&self, key: &KeySpec) -> Option<String>
Finds the command title bound to a key, if any.
Sourcepub fn run_command(
&mut self,
title: &str,
ctx: &EditorContext,
) -> Vec<EditorAction>
pub fn run_command( &mut self, title: &str, ctx: &EditorContext, ) -> Vec<EditorAction>
Runs a command by title, returning the actions it requested.
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PluginHost
impl !RefUnwindSafe for PluginHost
impl !Send for PluginHost
impl !Sync for PluginHost
impl !UnwindSafe for PluginHost
impl Unpin for PluginHost
impl UnsafeUnpin for PluginHost
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