[−][src]Struct webtonic_server::Router
A Router
is used to compile Routes
, by adding services.
Implementations
impl<A, B> Router<A, B>
[src]
pub fn add_service<C>(self, service: C) -> Router<C, Route<A, B>> where
C: Service<Request<BoxBody>, Response = Response<BoxBody>, Error = Never>,
[src]
C: Service<Request<BoxBody>, Response = Response<BoxBody>, Error = Never>,
Add a Service
to the route (see example).
Arguments
service
: theService
to add
Returns
- A new
Router
, which included the old routes and the new service.
pub async fn serve<U>(self, addr: U) where
U: Into<SocketAddr>,
A: Service<Request<BoxBody>, Response = Response<BoxBody>, Error = Never> + NamedService + Clone + Send + Sync + 'static,
A::Future: Send + 'static,
B: Service<(String, Request<BoxBody>), Response = Response<BoxBody>, Error = Never> + Clone + Send + Sync + 'static,
B::Future: Send + 'static,
[src]
U: Into<SocketAddr>,
A: Service<Request<BoxBody>, Response = Response<BoxBody>, Error = Never> + NamedService + Clone + Send + Sync + 'static,
A::Future: Send + 'static,
B: Service<(String, Request<BoxBody>), Response = Response<BoxBody>, Error = Never> + Clone + Send + Sync + 'static,
B::Future: Send + 'static,
Trait Implementations
impl<A: Clone, B: Clone> Clone for Router<A, B>
[src]
impl<A: Debug, B: Debug> Debug for Router<A, B>
[src]
Auto Trait Implementations
impl<A, B> RefUnwindSafe for Router<A, B> where
A: RefUnwindSafe,
B: RefUnwindSafe,
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for Router<A, B> where
A: Send,
B: Send,
A: Send,
B: Send,
impl<A, B> Sync for Router<A, B> where
A: Sync,
B: Sync,
A: Sync,
B: Sync,
impl<A, B> Unpin for Router<A, B> where
A: Unpin,
B: Unpin,
A: Unpin,
B: Unpin,
impl<A, B> UnwindSafe for Router<A, B> where
A: UnwindSafe,
B: UnwindSafe,
A: UnwindSafe,
B: UnwindSafe,
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> 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> IntoRequest<T> for T
[src]
pub fn into_request(self) -> Request<T>
[src]
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,