Struct viz::prelude::Route [−][src]
pub struct Route { /* fields omitted */ }
Expand description
Route
Implementations
Appends a middleware
pub fn on<H, A>(self, method: Method, h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
pub fn on<H, A>(self, method: Method, h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
Appends a route, handle HTTP verb
pub fn get<H, A>(self, h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
pub fn get<H, A>(self, h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
Appends a route, handle HTTP verb GET
pub fn post<H, A>(self, h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
pub fn post<H, A>(self, h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
Appends a route, handle HTTP verb POST
pub fn put<H, A>(self, h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
pub fn put<H, A>(self, h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
Appends a route, handle HTTP verb PUT
pub fn delete<H, A>(self, h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
pub fn delete<H, A>(self, h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
Appends a route, handle HTTP verb DELETE
pub fn options<H, A>(self, h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
pub fn options<H, A>(self, h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
Appends a route, handle HTTP verb OPTIONS
pub fn connect<H, A>(self, h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
pub fn connect<H, A>(self, h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
Appends a route, handle HTTP verb CONNECT
pub fn patch<H, A>(self, h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
pub fn patch<H, A>(self, h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
Appends a route, handle HTTP verb PATCH
pub fn trace<H, A>(self, h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
pub fn trace<H, A>(self, h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
Appends a route, handle HTTP verb TRACE
pub fn any<H, A>(self, h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
pub fn any<H, A>(self, h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
Appends a route, handle any HTTP verbs
pub fn only<H, A, const S: usize>(self, methods: [Method; S], h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
pub fn only<H, A, const S: usize>(self, methods: [Method; S], h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
Appends a route, only handle HTTP verbs
pub fn except<H, A, const S: usize>(self, methods: [Method; S], h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
pub fn except<H, A, const S: usize>(self, methods: [Method; S], h: H) -> Route where
A: Extract,
H: Handler<A>,
<A as Extract>::Error: Into<Response>,
<H as Handler<A>>::Output: Into<Response>,
<H as Handler<A>>::Future: 'static,
<H as Handler<A>>::Future: Future,
<H as Handler<A>>::Future: Send,
Endpoint<H, A>: for<'m> Handle<'m, Context>,
<<H as Handler<A>>::Future as Future>::Output == <H as Handler<A>>::Output,
<Endpoint<H, A> as Handle<'m, Context>>::Output == Result<Response, Error>,
Appends a route, except handle verbs
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Route
impl !UnwindSafe for Route
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