1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use PathBuf;
use crateBundle;
/// 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 directory
/// * `bundle` - Reference to the plugin's bundle metadata (id, version, format)
///
/// # Example
///
/// ```rust,no_run
/// 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())
/// }
/// }
/// ```