Struct runtime_injector_actix::TransientProvider [−][src]
pub struct TransientProvider<D, R, F> where
R: Service,
F: ServiceFactory<D, Result = R>, { /* fields omitted */ }
A service provider that creates an instance of the service each time it is requested. This will never return two service pointers to the same instance of a service.
Implementations
impl<D, R, F> TransientProvider<D, R, F> where
R: Service,
F: ServiceFactory<D, Result = R>,
[src]
impl<D, R, F> TransientProvider<D, R, F> where
R: Service,
F: ServiceFactory<D, Result = R>,
[src]#[must_use]pub fn new(func: F) -> TransientProvider<D, R, F>
[src]
#[must_use]pub fn new(func: F) -> TransientProvider<D, R, F>
[src]Creates a new TransientProvider
using a service factory.
Trait Implementations
impl<D, R, F> From<F> for TransientProvider<D, R, F> where
R: Service,
F: ServiceFactory<D, Result = R>,
[src]
impl<D, R, F> From<F> for TransientProvider<D, R, F> where
R: Service,
F: ServiceFactory<D, Result = R>,
[src]pub fn from(func: F) -> TransientProvider<D, R, F>
[src]
pub fn from(func: F) -> TransientProvider<D, R, F>
[src]Performs the conversion.
impl<D, R, F> TypedProvider for TransientProvider<D, R, F> where
R: Service,
F: ServiceFactory<D, Result = R> + Service,
D: Service,
[src]
impl<D, R, F> TypedProvider for TransientProvider<D, R, F> where
R: Service,
F: ServiceFactory<D, Result = R> + Service,
D: Service,
[src]type Result = R
type Result = R
The type of service this provider can activate.
pub fn provide_typed(
&mut self,
injector: &Injector,
request_info: RequestInfo
) -> Result<Arc<<TransientProvider<D, R, F> as TypedProvider>::Result>, InjectError>
[src]
pub fn provide_typed(
&mut self,
injector: &Injector,
request_info: RequestInfo
) -> Result<Arc<<TransientProvider<D, R, F> as TypedProvider>::Result>, InjectError>
[src]pub fn provide_owned_typed(
&mut self,
injector: &Injector,
request_info: RequestInfo
) -> Result<Box<<TransientProvider<D, R, F> as TypedProvider>::Result, Global>, InjectError>
[src]
pub fn provide_owned_typed(
&mut self,
injector: &Injector,
request_info: RequestInfo
) -> Result<Box<<TransientProvider<D, R, F> as TypedProvider>::Result, Global>, InjectError>
[src]Provides an owned instance of the service. Not all providers can provide an owned variant of the service. Read more
fn with_interface<I>(self) -> InterfaceProvider<I, Self> where
I: InterfaceFor<Self::Result> + ?Sized,
[src]
fn with_interface<I>(self) -> InterfaceProvider<I, Self> where
I: InterfaceFor<Self::Result> + ?Sized,
[src]Provides this service as an implementation of a particular interface. Rather than requesting this service with its concrete type, it can instead be requested by its interface type. Read more
Auto Trait Implementations
impl<D, R, F> RefUnwindSafe for TransientProvider<D, R, F> where
F: RefUnwindSafe,
F: RefUnwindSafe,
impl<D, R, F> Send for TransientProvider<D, R, F> where
F: Send,
F: Send,
impl<D, R, F> Sync for TransientProvider<D, R, F> where
F: Sync,
F: Sync,
impl<D, R, F> Unpin for TransientProvider<D, R, F> where
F: Unpin,
F: Unpin,
impl<D, R, F> UnwindSafe for TransientProvider<D, R, F> where
F: UnwindSafe,
F: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Interface for T where
T: Service,
[src]
impl<T> Interface for T where
T: Service,
[src]impl<T> Provider for T where
T: TypedProvider,
[src]
impl<T> Provider for T where
T: TypedProvider,
[src]pub fn result(&self) -> ServiceInfo
[src]
pub fn result(&self) -> ServiceInfo
[src]The ServiceInfo
which describes the type returned by this provider.
pub fn provide(
&mut self,
injector: &Injector,
request_info: RequestInfo
) -> Result<Arc<dyn Any + 'static + Sync + Send>, InjectError>
[src]
pub fn provide(
&mut self,
injector: &Injector,
request_info: RequestInfo
) -> Result<Arc<dyn Any + 'static + Sync + Send>, InjectError>
[src]Provides an instance of the service.
pub fn provide_owned(
&mut self,
injector: &Injector,
request_info: RequestInfo
) -> Result<Box<dyn Any + 'static + Sync + Send, Global>, InjectError>
[src]
pub fn provide_owned(
&mut self,
injector: &Injector,
request_info: RequestInfo
) -> Result<Box<dyn Any + 'static + Sync + Send, Global>, InjectError>
[src]Provides an owned instance of the service.
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> InterfaceFor<T> for T where
T: Service,
[src]
T: Service,
impl<T> Service for T where
T: Any + Send + Sync + ?Sized,
[src]
T: Any + Send + Sync + ?Sized,