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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//! Plugin system for TrustformeRS.
//!
//! This module provides a flexible plugin architecture that allows custom layers
//! and components to be dynamically loaded and integrated into TrustformeRS models.
//! The plugin system supports version compatibility, discovery, and runtime loading.
//!
//! # Overview
//!
//! The plugin system consists of:
//!
//! - [`Plugin`]: Core trait for plugin implementations
//! - [`PluginRegistry`]: Central registry for plugin discovery and management
//! - [`PluginInfo`]: Metadata about plugin capabilities and compatibility
//! - [`PluginLoader`]: Dynamic loading of plugin implementations
//!
//! # Example
//!
//! ```no_run
//! use trustformers_core::plugins::{PluginRegistry, PluginInfo, PluginManager};
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Register a custom plugin
//! let registry = PluginRegistry::new();
//! registry.register("custom_attention", PluginInfo::new(
//! "custom_attention",
//! "1.0.0",
//! "Custom attention mechanism",
//! &["trustformers-core >= 0.1.0"]
//! ))?;
//!
//! // List available plugins
//! let plugins = registry.list_plugins();
//! assert!(plugins.contains(&"custom_attention".to_string()));
//! # Ok(())
//! # }
//! ```
pub use ;
pub use PluginLoader;
pub use PluginRegistry;
pub use ;
use crateResult;
use HashMap;
/// Plugin discovery and management interface.
///
/// This trait provides methods for discovering available plugins,
/// checking compatibility, and loading plugin instances.