pub struct AdapterRegistry { /* private fields */ }Expand description
A collection of platform adapters, indexed by name.
The registry owns the adapters and provides lookup by name. It can be
constructed with the built-in adapters via AdapterRegistry::builtin(),
or built manually for testing.
Implementations§
Source§impl AdapterRegistry
impl AdapterRegistry
Sourcepub fn new(adapters: Vec<Box<dyn PlatformAdapter>>) -> Self
pub fn new(adapters: Vec<Box<dyn PlatformAdapter>>) -> Self
Create a registry from a vec of boxed adapters.
Sourcepub fn get(&self, name: &str) -> Option<&dyn PlatformAdapter>
pub fn get(&self, name: &str) -> Option<&dyn PlatformAdapter>
Look up an adapter by name.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AdapterRegistry
impl !RefUnwindSafe for AdapterRegistry
impl Send for AdapterRegistry
impl Sync for AdapterRegistry
impl Unpin for AdapterRegistry
impl UnsafeUnpin for AdapterRegistry
impl !UnwindSafe for AdapterRegistry
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