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 !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