pub struct OneOf<Iface>where
Iface: 'static + ?Sized + Send + Sync,{ /* private fields */ }
Expand description
Builds a single instance of type implementing specific interface. Will return an error if no implementations or multiple implementations were found.
Trait Implementations§
source§impl DependencySpec for OneOf<Catalog>
impl DependencySpec for OneOf<Catalog>
fn get(cat: &Catalog) -> Result<Self::ReturnType, InjectionError>
fn check(_: &Catalog) -> Result<(), InjectionError>
type ReturnType
source§impl<Iface> DependencySpec for OneOf<Iface>where
Iface: 'static + ?Sized + Send + Sync,
impl<Iface> DependencySpec for OneOf<Iface>where Iface: 'static + ?Sized + Send + Sync,
type ReturnType = Arc<Iface>
default fn get(cat: &Catalog) -> Result<Self::ReturnType, InjectionError>
default fn check(cat: &Catalog) -> Result<(), InjectionError>
Auto Trait Implementations§
impl<Iface: ?Sized> RefUnwindSafe for OneOf<Iface>where Iface: RefUnwindSafe,
impl<Iface: ?Sized> Send for OneOf<Iface>
impl<Iface: ?Sized> Sync for OneOf<Iface>
impl<Iface: ?Sized> Unpin for OneOf<Iface>where Iface: Unpin,
impl<Iface: ?Sized> UnwindSafe for OneOf<Iface>where Iface: UnwindSafe,
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