Struct runtime_injector::FallibleServiceFactory[][src]

pub struct FallibleServiceFactory<D, R, E, F> where
    D: Service,
    R: Service,
    E: Service + Error,
    F: ServiceFactory<D, Result = Result<R, E>>, 
{ /* fields omitted */ }
Expand description

A service factory that may fail during service creation with a custom error type. During activation failure, an instance of InjectError::ActivationFailed is returned as an error.

Trait Implementations

impl<D, R, E, F> ServiceFactory<D> for FallibleServiceFactory<D, R, E, F> where
    D: Service,
    R: Service,
    E: Service + Error,
    F: ServiceFactory<D, Result = Result<R, E>>, 
[src]

type Result = R

The resulting service from invoking this service factory.

fn invoke(
    &mut self,
    injector: &Injector,
    request_info: &RequestInfo
) -> InjectResult<Self::Result>
[src]

Invokes this service factory, creating an instance of the service.

Auto Trait Implementations

impl<D, R, E, F> RefUnwindSafe for FallibleServiceFactory<D, R, E, F> where
    F: RefUnwindSafe

impl<D, R, E, F> Send for FallibleServiceFactory<D, R, E, F>

impl<D, R, E, F> Sync for FallibleServiceFactory<D, R, E, F>

impl<D, R, E, F> Unpin for FallibleServiceFactory<D, R, E, F> where
    F: Unpin

impl<D, R, E, F> UnwindSafe for FallibleServiceFactory<D, R, E, F> where
    F: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.