pub struct ServiceDescriptorBuilder<TSvc: Any + ?Sized, TImpl> { /* private fields */ }
Available on crate feature
builder
only.Expand description
Represents a ServiceDescriptor
builder.
Implementations§
Source§impl<TSvc: Any + ?Sized, TImpl> ServiceDescriptorBuilder<TSvc, TImpl>
impl<TSvc: Any + ?Sized, TImpl> ServiceDescriptorBuilder<TSvc, TImpl>
Sourcepub fn from(
self,
factory: impl Fn(&ServiceProvider) -> Ref<TSvc> + 'static,
) -> ServiceDescriptor
pub fn from( self, factory: impl Fn(&ServiceProvider) -> Ref<TSvc> + 'static, ) -> ServiceDescriptor
Defines the factory method used to activate the service and returns the ServiceDescriptor
.
§Arguments
factory
- The factory method used to create the service
Sourcepub fn depends_on(self, dependency: ServiceDependency) -> Self
pub fn depends_on(self, dependency: ServiceDependency) -> Self
Defines a dependency used by the service.
§Arguments
dependency
- The dependency associated with the service
Sourcepub fn new(lifetime: ServiceLifetime, implementation_type: Type) -> Self
pub fn new(lifetime: ServiceLifetime, implementation_type: Type) -> Self
Auto Trait Implementations§
impl<TSvc, TImpl> Freeze for ServiceDescriptorBuilder<TSvc, TImpl>where
TSvc: ?Sized,
impl<TSvc, TImpl> RefUnwindSafe for ServiceDescriptorBuilder<TSvc, TImpl>
impl<TSvc, TImpl> Send for ServiceDescriptorBuilder<TSvc, TImpl>
impl<TSvc, TImpl> Sync for ServiceDescriptorBuilder<TSvc, TImpl>
impl<TSvc, TImpl> Unpin for ServiceDescriptorBuilder<TSvc, TImpl>
impl<TSvc, TImpl> UnwindSafe for ServiceDescriptorBuilder<TSvc, TImpl>
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