Struct routerify_unixsocket::UnixRouterService [−][src]
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
Brepresents the response body type which will be used by route handlers and the middlewares and this body type must implement theHttpBodytrait. For an instance,Bcould behyper::Bodytype. - The
Erepresents any error type which will be used by route handlers and the middlewares. This error type must implement thestd::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]
B: HttpBody + Send + Sync + 'static,
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.
fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>[src]
fn call(&mut self, conn: &UnixStream) -> Self::Future[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T> Instrument for T[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>[src]
pub fn in_current_span(self) -> Instrumented<Self>[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, Request> ServiceExt<Request> for T where
T: Service<Request> + ?Sized, [src]
T: Service<Request> + ?Sized,
pub fn ready(&mut self) -> Ready<'_, Self, Request>[src]
pub fn ready_and(&mut self) -> Ready<'_, Self, Request>[src]
pub fn ready_oneshot(self) -> ReadyOneshot<Self, Request>[src]
pub fn oneshot(self, req: Request) -> Oneshot<Self, Request>[src]
pub fn call_all<S>(self, reqs: S) -> CallAll<Self, S> where
S: Stream<Item = Request>,
Self::Error: Into<Box<dyn Error + 'static + Send + Sync, Global>>, [src]
S: Stream<Item = Request>,
Self::Error: Into<Box<dyn Error + 'static + Send + Sync, Global>>,
pub fn and_then<F>(self, f: F) -> AndThen<Self, F> where
F: Clone, [src]
F: Clone,
pub fn map_response<F, Response>(self, f: F) -> MapResponse<Self, F> where
F: FnOnce(Self::Response) -> Response + Clone, [src]
F: FnOnce(Self::Response) -> Response + Clone,
pub fn map_err<F, Error>(self, f: F) -> MapErr<Self, F> where
F: FnOnce(Self::Error) -> Error + Clone, [src]
F: FnOnce(Self::Error) -> Error + Clone,
pub fn map_result<F, Response, Error>(self, f: F) -> MapResult<Self, F> where
Error: From<Self::Error>,
F: FnOnce(Result<Self::Response, Self::Error>) -> Result<Response, Error> + Clone, [src]
Error: From<Self::Error>,
F: FnOnce(Result<Self::Response, Self::Error>) -> Result<Response, Error> + Clone,
pub fn map_request<F, NewRequest>(self, f: F) -> MapRequest<Self, F> where
F: FnMut(NewRequest) -> Request + Clone, [src]
F: FnMut(NewRequest) -> Request + Clone,
pub fn then<F, Response, Error, Fut>(self, f: F) -> Then<Self, F> where
Error: From<Self::Error>,
F: FnOnce(Result<Self::Response, Self::Error>) -> Fut + Clone,
Fut: Future<Output = Result<Response, Error>>, [src]
Error: From<Self::Error>,
F: FnOnce(Result<Self::Response, Self::Error>) -> Fut + Clone,
Fut: Future<Output = Result<Response, Error>>,
pub fn map_future<F, Fut, Response, Error>(self, f: F) -> MapFuture<Self, F> where
Error: From<Self::Error>,
F: FnMut(Self::Future) -> Fut,
Fut: Future<Output = Result<Response, Error>>, [src]
Error: From<Self::Error>,
F: FnMut(Self::Future) -> Fut,
Fut: Future<Output = Result<Response, Error>>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,