pub struct ProviderRegistry {
providers: RwLock<HashMap<String, Arc<dyn Provider>>>,
metadata: RwLock<HashMap<String, ProviderMetadata>>,
context: Arc<dyn ProviderContext>,
}
Expand description
Provider registry manages all loaded providers
Fields§
§providers: RwLock<HashMap<String, Arc<dyn Provider>>>
Map of provider name to provider instance
metadata: RwLock<HashMap<String, ProviderMetadata>>
Map of provider name to metadata
context: Arc<dyn ProviderContext>
Provider context for execution
Implementations§
Source§impl ProviderRegistry
impl ProviderRegistry
Sourcepub fn new(context: Arc<dyn ProviderContext>) -> Self
pub fn new(context: Arc<dyn ProviderContext>) -> Self
Create a new provider registry
Sourcepub async fn register_provider(
&self,
provider: Arc<dyn Provider>,
metadata: ProviderMetadata,
) -> ProviderResult<()>
pub async fn register_provider( &self, provider: Arc<dyn Provider>, metadata: ProviderMetadata, ) -> ProviderResult<()>
Register a provider
Sourcepub async fn get_provider(&self, name: &str) -> Option<Arc<dyn Provider>>
pub async fn get_provider(&self, name: &str) -> Option<Arc<dyn Provider>>
Get a provider by name
Sourcepub async fn get_metadata(&self, name: &str) -> Option<ProviderMetadata>
pub async fn get_metadata(&self, name: &str) -> Option<ProviderMetadata>
Get provider metadata
Sourcepub async fn list_providers(&self) -> Vec<String>
pub async fn list_providers(&self) -> Vec<String>
List all provider names
Sourcepub async fn has_provider(&self, name: &str) -> bool
pub async fn has_provider(&self, name: &str) -> bool
Check if provider exists
Sourcepub async fn list_metadata(&self) -> Vec<ProviderMetadata>
pub async fn list_metadata(&self) -> Vec<ProviderMetadata>
Get all provider metadata
Sourcepub async fn execute_operation(
&self,
provider_name: &str,
feature: &str,
operation: &str,
args: HashMap<String, Value>,
) -> ProviderResult<Value>
pub async fn execute_operation( &self, provider_name: &str, feature: &str, operation: &str, args: HashMap<String, Value>, ) -> ProviderResult<Value>
Execute an operation on a provider
Sourcepub async fn get_feature_operations(
&self,
provider_name: &str,
feature: &str,
) -> ProviderResult<Vec<String>>
pub async fn get_feature_operations( &self, provider_name: &str, feature: &str, ) -> ProviderResult<Vec<String>>
Get operations for a feature
Sourcepub async fn get_statistics(&self) -> ProviderRegistryStats
pub async fn get_statistics(&self) -> ProviderRegistryStats
Get registry statistics
Sourcepub async fn initialize_all(&self) -> ProviderResult<()>
pub async fn initialize_all(&self) -> ProviderResult<()>
Initialize all providers
Sourcepub async fn shutdown_all(&self) -> ProviderResult<()>
pub async fn shutdown_all(&self) -> ProviderResult<()>
Shutdown all providers
Auto Trait Implementations§
impl !Freeze for ProviderRegistry
impl !RefUnwindSafe for ProviderRegistry
impl Send for ProviderRegistry
impl Sync for ProviderRegistry
impl Unpin for ProviderRegistry
impl !UnwindSafe for ProviderRegistry
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