pub struct ProviderKey { /* private fields */ }Expand description
Key of a provider in the container: a type plus an optional name, so
Db and Db("analytics") can coexist.
Implementations§
Source§impl ProviderKey
impl ProviderKey
Sourcepub fn of<T: ?Sized + 'static>() -> Self
pub fn of<T: ?Sized + 'static>() -> Self
The unnamed key of type T (which may be a trait object such as dyn Mailer).
Sourcepub fn named<T: ?Sized + 'static>(name: impl Into<Cow<'static, str>>) -> Self
pub fn named<T: ?Sized + 'static>(name: impl Into<Cow<'static, str>>) -> Self
The key of type T registered under name.
Trait Implementations§
Source§impl Clone for ProviderKey
impl Clone for ProviderKey
Source§impl Debug for ProviderKey
impl Debug for ProviderKey
Source§impl Display for ProviderKey
impl Display for ProviderKey
impl Eq for ProviderKey
Source§impl Hash for ProviderKey
impl Hash for ProviderKey
Auto Trait Implementations§
impl Forget for ProviderKey
impl Freeze for ProviderKey
impl Move for ProviderKey
impl RefUnwindSafe for ProviderKey
impl Send for ProviderKey
impl Sync for ProviderKey
impl Unpin for ProviderKey
impl UnsafeUnpin for ProviderKey
impl UnwindSafe for ProviderKey
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