pub struct RegisterPluginContext<'a> {
pub path: &'a PathBuf,
pub bundle: &'a Bundle,
}Expand description
Context provided during plugin registration.
RegisterPluginContext contains information about a plugin that is being registered with a manager. It provides access to the plugin’s filesystem location and metadata.
§Type Parameters
'a- Lifetime of the references
§Fields
path- Reference to the filesystem path of the plugin file or directorybundle- Reference to the plugin’s bundle metadata (id, version, format)
§Example
use plux_rs::{Manager, RegisterPluginContext, StdInfo, utils::ManagerResult};
use std::path::PathBuf;
struct MyManager;
impl Manager<'_, (), StdInfo> for MyManager {
fn format(&self) -> &'static str { "my" }
fn register_plugin(&mut self, context: RegisterPluginContext) -> ManagerResult<StdInfo> {
println!("Registering plugin: {}", context.bundle.id);
println!("Plugin path: {:?}", context.path);
Ok(StdInfo::new())
}
}Fields§
§path: &'a PathBufFilesystem path to the plugin file or directory
bundle: &'a BundlePlugin bundle metadata (id, version, format)
Auto Trait Implementations§
impl<'a> Freeze for RegisterPluginContext<'a>
impl<'a> RefUnwindSafe for RegisterPluginContext<'a>
impl<'a> Send for RegisterPluginContext<'a>
impl<'a> Sync for RegisterPluginContext<'a>
impl<'a> Unpin for RegisterPluginContext<'a>
impl<'a> UnsafeUnpin for RegisterPluginContext<'a>
impl<'a> UnwindSafe for RegisterPluginContext<'a>
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