pub trait SendService<Request>: Sealed<Request> {
type Service: Service<Request, Response = Response<Self::Body>, Error = Self::Error, Future = Self::Future> + Send + 'static;
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;
// Required method
fn into_service(self) -> Self::Service;
}
Expand description
An alias trait for the Service
trait, specialized with required bounds for the server’s service function.
This trait has been sealed, ensuring it cannot be implemented by types outside of this crate.
It provides constraints for the body data, errors, and asynchronous behavior that fits the server’s needs.
Required Associated Types§
type Service: Service<Request, Response = Response<Self::Body>, Error = Self::Error, Future = Self::Future> + Send + 'static
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
Required Methods§
Sourcefn into_service(self) -> Self::Service
fn into_service(self) -> Self::Service
Convert this type into a service.