Struct routerify_unixsocket::UnixRouterService[][src]

pub struct UnixRouterService<B, E> where
    B: HttpBody + Send + Sync + 'static, 
{ /* fields omitted */ }

A Service to process incoming requests. This is adapted from routerify’s RouterService in order to support handling the tokio::net::UnixStream instance passed by hyperlocal

This RouterService<B, E> type accepts two type parameters: B and E.

  • The B represents the response body type which will be used by route handlers and the middlewares and this body type must implement the HttpBody trait. For an instance, B could be hyper::Body type.
  • The E represents any error type which will be used by route handlers and the middlewares. This error type must implement the std::error::Error.

Implementations

impl<B: HttpBody + Send + Sync + 'static, E: Into<Box<dyn Error + Send + Sync>> + 'static> UnixRouterService<B, E>[src]

pub fn new(router: Router<B, E>) -> Result<UnixRouterService<B, E>>[src]

Creates a new service with the provided router and it’s ready to be used with the hyper serve method.

Trait Implementations

impl<B: Debug, E: Debug> Debug for UnixRouterService<B, E> where
    B: HttpBody + Send + Sync + 'static, 
[src]

impl<B: HttpBody + Send + Sync + 'static, E: Into<Box<dyn Error + Send + Sync>> + 'static> Service<&'_ UnixStream> for UnixRouterService<B, E>[src]

type Response = BoxService<Request<Body>, Response<B>, RouteError>

Responses given by the service.

type Error = Infallible

Errors produced by the service.

type Future = Ready<Result<Self::Response, Self::Error>>

The future response value.

Auto Trait Implementations

impl<B, E> !RefUnwindSafe for UnixRouterService<B, E>

impl<B, E> Send for UnixRouterService<B, E>

impl<B, E> Sync for UnixRouterService<B, E>

impl<B, E> Unpin for UnixRouterService<B, E>

impl<B, E> !UnwindSafe for UnixRouterService<B, E>

Blanket Implementations

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

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

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

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

impl<T> Instrument for T[src]

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

impl<T, Request> ServiceExt<Request> for T where
    T: Service<Request> + ?Sized
[src]

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.

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.