Struct hrpc::server::router::Routes [−][src]
pub struct Routes { /* fields omitted */ }
Expand description
Builder type for inserting HrpcService
s before building a RoutesFinalized
.
Implementations
pub fn route<S>(self, path: impl Into<Cow<'static, str>>, handler: S) -> Self where
S: Service<BoxRequest, Response = BoxResponse, Error = Infallible> + Send + 'static,
S::Future: Send,
pub fn route<S>(self, path: impl Into<Cow<'static, str>>, handler: S) -> Self where
S: Service<BoxRequest, Response = BoxResponse, Error = Infallible> + Send + 'static,
S::Future: Send,
Add a new route.
pub fn layer<L, S>(self, layer: L) -> Self where
L: Layer<HrpcService, Service = S>,
S: Service<BoxRequest, Response = BoxResponse, Error = Infallible> + Send + 'static,
S::Future: Send,
pub fn layer<L, S>(self, layer: L) -> Self where
L: Layer<HrpcService, Service = S>,
S: Service<BoxRequest, Response = BoxResponse, Error = Infallible> + Send + 'static,
S::Future: Send,
Layer the routes that were added until this.
pub fn layer_all<L, S>(self, layer: L) -> Self where
L: Layer<HrpcService, Service = S> + Sync + Send + 'static,
S: Service<BoxRequest, Response = BoxResponse, Error = Infallible> + Send + 'static,
S::Future: Send,
pub fn layer_all<L, S>(self, layer: L) -> Self where
L: Layer<HrpcService, Service = S> + Sync + Send + 'static,
S: Service<BoxRequest, Response = BoxResponse, Error = Infallible> + Send + 'static,
S::Future: Send,
Set layer for the finalized router service.
Combine this with another Routes
. Note that this cannot combine the any
handler.
pub fn any<S>(self, handler: S) -> Self where
S: Service<BoxRequest, Response = BoxResponse, Error = Infallible> + Send + 'static,
S::Future: Send,
pub fn any<S>(self, handler: S) -> Self where
S: Service<BoxRequest, Response = BoxResponse, Error = Infallible> + Send + 'static,
S::Future: Send,
Set the service that will be used if no routes are matched.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Routes
impl !UnwindSafe for Routes
Blanket Implementations
Mutably borrows from an owned value. Read more
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
Notable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
Notable traits for Instrumented<T>
impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
pub fn vzip(self) -> V
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
Notable traits for WithDispatch<T>
impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
Notable traits for WithDispatch<T>
impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more