Struct BoxServiceFactory

Source
pub struct BoxServiceFactory<F, Req> {
    pub inner: F,
    /* private fields */
}
Expand description

BoxServiceFactory wraps a service factory and produces BoxedService instances, allowing for type erasure in service creation pipelines.

Fields§

§inner: F

Implementations§

Source§

impl<F, Req> BoxServiceFactory<F, Req>

Source

pub fn new(inner: F) -> Self

Trait Implementations§

Source§

impl<F, Req> AsyncMakeService for BoxServiceFactory<F, Req>
where F: AsyncMakeService, F::Service: Service<Req> + 'static, Req: 'static,

Source§

type Service = BoxedService<Req, <<F as AsyncMakeService>::Service as Service<Req>>::Response, <<F as AsyncMakeService>::Service as Service<Req>>::Error>

The type of service this factory creates.
Source§

type Error = <F as AsyncMakeService>::Error

The type of error that can occur during service creation.
Source§

async fn make_via_ref( &self, old: Option<&Self::Service>, ) -> Result<Self::Service, Self::Error>

Asynchronously creates a new service, optionally using an existing service as a reference. Read more
Source§

fn make(&self) -> impl Future<Output = Result<Self::Service, Self::Error>>

Asynchronously creates a new service without referencing an existing one. Read more
Source§

impl<F, Req> MakeService for BoxServiceFactory<F, Req>
where F: MakeService, F::Service: Service<Req> + 'static, Req: 'static,

Source§

type Service = BoxedService<Req, <<F as MakeService>::Service as Service<Req>>::Response, <<F as MakeService>::Service as Service<Req>>::Error>

The type of service this factory creates.
Source§

type Error = <F as MakeService>::Error

The type of error that can occur during service creation.
Source§

fn make_via_ref( &self, old: Option<&Self::Service>, ) -> Result<Self::Service, Self::Error>

Creates a new service, optionally using an existing service as a reference. Read more
Source§

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

Creates a new service without referencing an existing one. Read more
Source§

impl<F: Send, Req> Send for BoxServiceFactory<F, Req>

Source§

impl<F: Sync, Req> Sync for BoxServiceFactory<F, Req>

Auto Trait Implementations§

§

impl<F, Req> Freeze for BoxServiceFactory<F, Req>
where F: Freeze,

§

impl<F, Req> RefUnwindSafe for BoxServiceFactory<F, Req>

§

impl<F, Req> Unpin for BoxServiceFactory<F, Req>
where F: Unpin, Req: Unpin,

§

impl<F, Req> UnwindSafe for BoxServiceFactory<F, Req>
where F: UnwindSafe, Req: 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>,

Source§

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

Source§

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.