pub struct ServiceDescriptor { /* private fields */ }
Expand description
Represents the description of a service with its service type, implementation, and lifetime.
Implementations§
Source§impl ServiceDescriptor
impl ServiceDescriptor
Sourcepub fn lifetime(&self) -> ServiceLifetime
pub fn lifetime(&self) -> ServiceLifetime
Gets the lifetime associated with the service descriptor.
Sourcepub fn service_type(&self) -> &Type
pub fn service_type(&self) -> &Type
Gets the service type associated with the service descriptor.
Sourcepub fn implementation_type(&self) -> &Type
pub fn implementation_type(&self) -> &Type
Gets the implementation type associated with the service descriptor.
Sourcepub fn dependencies(&self) -> &[ServiceDependency]
pub fn dependencies(&self) -> &[ServiceDependency]
Gets the associated service dependencies, if any.
Sourcepub fn get(&self, services: &ServiceProvider) -> Ref<dyn Any>
pub fn get(&self, services: &ServiceProvider) -> Ref<dyn Any>
Gets or creates the service defined by the service descriptor.
§Arguments
services
- The currentServiceProvider
Trait Implementations§
Source§impl Clone for ServiceDescriptor
impl Clone for ServiceDescriptor
Source§impl From<InjectBuilder> for ServiceDescriptor
impl From<InjectBuilder> for ServiceDescriptor
Source§fn from(value: InjectBuilder) -> Self
fn from(value: InjectBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ServiceDescriptor
impl !RefUnwindSafe for ServiceDescriptor
impl !Send for ServiceDescriptor
impl !Sync for ServiceDescriptor
impl Unpin for ServiceDescriptor
impl !UnwindSafe for ServiceDescriptor
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