pub struct FactoryStack<C, S> { /* private fields */ }

Implementations§

source§

impl<C> FactoryStack<C, ()>

source

pub const fn new(config: C) -> Self

source§

impl<C, F> FactoryStack<C, F>

source

pub fn replace<NF>(self, factory: NF) -> FactoryStack<C, NF>

Replace inner with a new factory.

source

pub fn push<L>(self, layer: L) -> FactoryStack<C, L::Factory>
where L: FactoryLayer<C, F>,

Push a new factory layer.

source

pub fn push_map_target<M: Clone>( self, f: M ) -> FactoryStack<C, MapTargetService<F, M>>

Push a new factory of service to map the request type.

source

pub fn push_boxed_service<Req>( self ) -> FactoryStack<C, BoxServiceFactory<F, Req>>
where F: MakeService, F::Service: Service<Req>,

Push a new factory of BoxedService.

source

pub fn push_boxed_factory( self ) -> FactoryStack<C, BoxedMakeService<F::Service, F::Error>>
where F: MakeService + Send + Sync + 'static,

Push a new factory wrapper to get a fixed type factory.

source

pub fn push_arc_factory( self ) -> FactoryStack<C, ArcMakeService<F::Service, F::Error>>
where F: MakeService + Send + Sync + 'static,

Push a new factory wrapper to get a fixed type factory.

source

pub fn check_make_svc<R>(self) -> Self
where F: MakeService, F::Service: Service<R>,

Check if the stack is a factory of Service.

source

pub fn into_inner(self) -> F

Get the inner factory.

source

pub fn into_parts(self) -> (C, F)

Into config and the factory.

source§

impl<C, F> FactoryStack<C, F>
where F: MakeService,

source

pub fn make(&self) -> Result<F::Service, F::Error>

Make a service.

Auto Trait Implementations§

§

impl<C, S> RefUnwindSafe for FactoryStack<C, S>

§

impl<C, S> Send for FactoryStack<C, S>
where C: Send, S: Send,

§

impl<C, S> Sync for FactoryStack<C, S>
where C: Sync, S: Sync,

§

impl<C, S> Unpin for FactoryStack<C, S>
where C: Unpin, S: Unpin,

§

impl<C, S> UnwindSafe for FactoryStack<C, S>
where C: UnwindSafe, S: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.