pub struct AdapterRegistry { /* private fields */ }Expand description
Registry of adapter handles, keyed by AdapterId.
Implementations§
Source§impl AdapterRegistry
impl AdapterRegistry
pub fn new() -> AdapterRegistry
Sourcepub fn register(
&mut self,
adapter: Arc<dyn Adapter>,
) -> Option<Arc<dyn Adapter>>
pub fn register( &mut self, adapter: Arc<dyn Adapter>, ) -> Option<Arc<dyn Adapter>>
Register an adapter handle keyed by its AdapterId. Returns the
previous handle for that id if one was already registered, mirroring
std::collections::HashMap::insert. Callers can detect duplicate
registrations by checking for Some(_).
pub fn get(&self, id: AdapterId) -> Option<Arc<dyn Adapter>>
Trait Implementations§
Source§impl Default for AdapterRegistry
impl Default for AdapterRegistry
Source§fn default() -> AdapterRegistry
fn default() -> AdapterRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for AdapterRegistry
impl !UnwindSafe for AdapterRegistry
impl Freeze for AdapterRegistry
impl Send for AdapterRegistry
impl Sync for AdapterRegistry
impl Unpin for AdapterRegistry
impl UnsafeUnpin 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more