Trait axum_server::service::MakeService

source ·
pub trait MakeService<Target, Request>: Sealed<(Target, Request)> {
    type Service: Service<Request, Response = Response<Self::Body>, Error = Self::Error, Future = Self::Future> + Send + 'static + Clone;
    type Body: Body<Data = Self::BodyData, Error = Self::BodyError> + Send + 'static;
    type BodyData: Send + 'static;
    type BodyError: Into<Box<dyn Error + Send + Sync>>;
    type Error: Into<Box<dyn Error + Send + Sync>>;
    type Future: Future<Output = Result<Response<Self::Body>, Self::Error>> + Send + 'static;
    type MakeError: Into<Box<dyn Error + Send + Sync>>;
    type MakeFuture: Future<Output = Result<Self::Service, Self::MakeError>>;

    // Required methods
    fn poll_ready(
        &mut self,
        cx: &mut Context<'_>,
    ) -> Poll<Result<(), Self::MakeError>>;
    fn make_service(&mut self, target: Target) -> Self::MakeFuture;
}
Expand description

Modified version of MakeService that takes a &Target and has required trait bounds for serve.

This trait is sealed and cannot be implemented for types outside this crate.

Required Associated Types§

source

type Service: Service<Request, Response = Response<Self::Body>, Error = Self::Error, Future = Self::Future> + Send + 'static + Clone

source

type Body: Body<Data = Self::BodyData, Error = Self::BodyError> + Send + 'static

source

type BodyData: Send + 'static

source

type BodyError: Into<Box<dyn Error + Send + Sync>>

source

type Error: Into<Box<dyn Error + Send + Sync>>

source

type Future: Future<Output = Result<Response<Self::Body>, Self::Error>> + Send + 'static

source

type MakeError: Into<Box<dyn Error + Send + Sync>>

source

type MakeFuture: Future<Output = Result<Self::Service, Self::MakeError>>

Required Methods§

source

fn poll_ready( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::MakeError>>

source

fn make_service(&mut self, target: Target) -> Self::MakeFuture

Implementors§

source§

impl<T, S, B, E, F, Target, Request> MakeService<Target, Request> for T
where T: Service<Target, Response = S, Error = E, Future = F>, S: Service<Request, Response = Response<B>> + Send + Clone + 'static, S::Error: Into<Box<dyn Error + Send + Sync>>, S::Future: Send + 'static, B: Body + Send + 'static, B::Data: Send + 'static, B::Error: Into<Box<dyn Error + Send + Sync>>, E: Into<Box<dyn Error + Send + Sync>>, F: Future<Output = Result<S, E>>,

§

type Service = S

§

type Body = B

§

type BodyData = <B as Body>::Data

§

type BodyError = <B as Body>::Error

§

type Error = <S as Service<Request>>::Error

§

type Future = <S as Service<Request>>::Future

§

type MakeError = E

§

type MakeFuture = F