pub struct Activator { /* private fields */ }
Available on crate feature
inject
only.Expand description
Represents an activator for a service instance.
Implementations§
Source§impl Activator
impl Activator
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 as_mut(&mut self)
pub fn as_mut(&mut self)
Sets a value indicating whether the activated instance should be mutable.
Sourcepub fn factory(&self) -> Ref<ServiceFactory>
pub fn factory(&self) -> Ref<ServiceFactory>
Gets the factory method the activator represents.
Sourcepub fn new<TSvc: Any + ?Sized, TImpl>(
factory: fn(&ServiceProvider) -> Ref<TSvc>,
factory_mut: fn(&ServiceProvider) -> RefMut<TSvc>,
) -> Self
pub fn new<TSvc: Any + ?Sized, TImpl>( factory: fn(&ServiceProvider) -> Ref<TSvc>, factory_mut: fn(&ServiceProvider) -> RefMut<TSvc>, ) -> Self
Creates a new activator using the specified factory methods to instantiate the service.
§Arguments
factory
- The factory method used to create a service instancefactory_mut
- The factory method used to create a mutable service instance
Auto Trait Implementations§
impl Freeze for Activator
impl !RefUnwindSafe for Activator
impl !Send for Activator
impl !Sync for Activator
impl Unpin for Activator
impl !UnwindSafe for Activator
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