pub struct ProviderDefinition { /* private fields */ }Expand description
A provider registration, similar to a Nest provider entry.
Implementations§
Source§impl ProviderDefinition
impl ProviderDefinition
pub fn singleton<T>(value: T) -> Self
pub fn named_singleton<T>(token: impl Into<String>, value: T) -> Self
pub fn from_arc<T>(value: Arc<T>) -> Self
pub fn named_from_arc<T>(token: impl Into<String>, value: Arc<T>) -> Self
pub fn factory<T, F>(factory: F) -> Self
pub fn factory_arc<T, F>(factory: F) -> Self
pub fn named_factory<T, F>(token: impl Into<String>, factory: F) -> Self
pub fn named_factory_arc<T, F>(token: impl Into<String>, factory: F) -> Self
pub fn token(&self) -> &ProviderToken
Trait Implementations§
Source§impl Clone for ProviderDefinition
impl Clone for ProviderDefinition
Source§fn clone(&self) -> ProviderDefinition
fn clone(&self) -> ProviderDefinition
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ProviderDefinition
impl !UnwindSafe for ProviderDefinition
impl Freeze for ProviderDefinition
impl Send for ProviderDefinition
impl Sync for ProviderDefinition
impl Unpin for ProviderDefinition
impl UnsafeUnpin for ProviderDefinition
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