pub struct ProviderRegistry { /* private fields */ }Expand description
Registry that manages multiple HardwareProvider implementations.
Provides lookup by ProviderType and aggregated device listing across
all registered providers.
Implementations§
Source§impl ProviderRegistry
impl ProviderRegistry
Sourcepub fn register(&mut self, provider: Box<dyn HardwareProvider>)
pub fn register(&mut self, provider: Box<dyn HardwareProvider>)
Register a new hardware provider.
Sourcepub fn get(&self, provider: ProviderType) -> Option<&dyn HardwareProvider>
pub fn get(&self, provider: ProviderType) -> Option<&dyn HardwareProvider>
Look up a provider by its type discriminant.
Returns a reference to the first registered provider of the given type,
or None if no such provider has been registered.
Sourcepub fn all_devices(&self) -> Vec<DeviceInfo>
pub fn all_devices(&self) -> Vec<DeviceInfo>
Collect device info from every registered provider.
Trait Implementations§
Source§impl Default for ProviderRegistry
impl Default for ProviderRegistry
Source§fn default() -> Self
fn default() -> Self
Create a registry pre-loaded with the LocalSimulatorProvider.
Auto Trait Implementations§
impl Freeze for ProviderRegistry
impl !RefUnwindSafe for ProviderRegistry
impl Send for ProviderRegistry
impl Sync for ProviderRegistry
impl Unpin for ProviderRegistry
impl UnsafeUnpin 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