pub struct PluginLoader { /* private fields */ }Expand description
Plugin loader that discovers and loads plugins from the filesystem.
Implementations§
Source§impl PluginLoader
impl PluginLoader
Sourcepub fn with_workspace_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn with_workspace_dir(self, dir: impl Into<PathBuf>) -> Self
Set the workspace plugin directory.
Sourcepub fn discover(&self) -> Vec<PathBuf>
pub fn discover(&self) -> Vec<PathBuf>
Discover all plugin files in the configured directories.
Sourcepub fn load_all(&self) -> Vec<PluginResult<ConfigPlugin>> ⓘ
pub fn load_all(&self) -> Vec<PluginResult<ConfigPlugin>> ⓘ
Load all discovered plugins.
Sourcepub fn ensure_user_dir(&self) -> Result<()>
pub fn ensure_user_dir(&self) -> Result<()>
Ensure the user plugin directory exists.
Sourcepub fn user_plugin_dir(&self) -> Option<&Path>
pub fn user_plugin_dir(&self) -> Option<&Path>
Get the user plugin directory path.
Sourcepub fn create_example_plugin(&self) -> Result<PathBuf>
pub fn create_example_plugin(&self) -> Result<PathBuf>
Create an example plugin file.
Sourcepub fn discover_lua(&self) -> Vec<PathBuf>
pub fn discover_lua(&self) -> Vec<PathBuf>
Discover all Lua plugin files in the configured directories.
Sourcepub fn load_all_lua(&self) -> Vec<PluginResult<LuaPlugin>> ⓘ
pub fn load_all_lua(&self) -> Vec<PluginResult<LuaPlugin>> ⓘ
Load all discovered Lua plugins.
Sourcepub fn create_example_lua_plugin(&self) -> Result<PathBuf>
pub fn create_example_lua_plugin(&self) -> Result<PathBuf>
Create an example Lua plugin file.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PluginLoader
impl RefUnwindSafe for PluginLoader
impl Send for PluginLoader
impl Sync for PluginLoader
impl Unpin for PluginLoader
impl UnsafeUnpin for PluginLoader
impl UnwindSafe for PluginLoader
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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