pub struct ProviderMetadata {
pub service_type: ProviderType,
pub lifetime: Option<ServiceLifetime>,
pub dependencies: Vec<String>,
}
Expand description
Provider metadata extracted from module declarations
Fields§
§service_type: ProviderType
§lifetime: Option<ServiceLifetime>
§dependencies: Vec<String>
Implementations§
Source§impl ProviderMetadata
impl ProviderMetadata
Sourcepub fn concrete(service_name: String) -> Self
pub fn concrete(service_name: String) -> Self
Create new provider metadata for concrete service
Sourcepub fn trait_impl(trait_name: String, impl_name: String) -> Self
pub fn trait_impl(trait_name: String, impl_name: String) -> Self
Create new provider metadata for trait implementation
Sourcepub fn named_trait(trait_name: String, impl_name: String, name: String) -> Self
pub fn named_trait(trait_name: String, impl_name: String, name: String) -> Self
Create new provider metadata for named trait implementation
Sourcepub fn with_lifetime(self, lifetime: ServiceLifetime) -> Self
pub fn with_lifetime(self, lifetime: ServiceLifetime) -> Self
Set the service lifetime
Sourcepub fn with_dependency(self, dependency: String) -> Self
pub fn with_dependency(self, dependency: String) -> Self
Add a dependency
Trait Implementations§
Source§impl Clone for ProviderMetadata
impl Clone for ProviderMetadata
Source§fn clone(&self) -> ProviderMetadata
fn clone(&self) -> ProviderMetadata
Returns a duplicate of the value. Read more
1.0.0 · 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 Freeze for ProviderMetadata
impl RefUnwindSafe for ProviderMetadata
impl Send for ProviderMetadata
impl Sync for ProviderMetadata
impl Unpin for ProviderMetadata
impl UnwindSafe for ProviderMetadata
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