MethodRouter

Struct MethodRouter 

Source
pub struct MethodRouter { /* private fields */ }

Implementations§

Source§

impl MethodRouter

Source

pub fn options<S>(self, service: S) -> Self
where S: Service<Request> + 'static, S::Response: IntoResponse, S::Error: Into<BoxError>,

Source

pub fn get<S>(self, service: S) -> Self
where S: Service<Request> + 'static, S::Response: IntoResponse, S::Error: Into<BoxError>,

Source

pub fn post<S>(self, service: S) -> Self
where S: Service<Request> + 'static, S::Response: IntoResponse, S::Error: Into<BoxError>,

Source

pub fn put<S>(self, service: S) -> Self
where S: Service<Request> + 'static, S::Response: IntoResponse, S::Error: Into<BoxError>,

Source

pub fn delete<S>(self, service: S) -> Self
where S: Service<Request> + 'static, S::Response: IntoResponse, S::Error: Into<BoxError>,

Source

pub fn head<S>(self, service: S) -> Self
where S: Service<Request> + 'static, S::Response: IntoResponse, S::Error: Into<BoxError>,

Source

pub fn trace<S>(self, service: S) -> Self
where S: Service<Request> + 'static, S::Response: IntoResponse, S::Error: Into<BoxError>,

Source

pub fn patch<S>(self, service: S) -> Self
where S: Service<Request> + 'static, S::Response: IntoResponse, S::Error: Into<BoxError>,

Trait Implementations§

Source§

impl Debug for MethodRouter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Service<Request<BoxBody>> for MethodRouter

Source§

type Response = Response<BoxBody>

服务返回的响应。
Source§

type Error = Box<dyn Error>

服务产生的错误。
Source§

type Future = RouteFuture

异步返回的响应。
Source§

fn call(&self, request: Request) -> Self::Future

处理请求并异步返回响应。

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<S, Req> ServiceExt<Req> for S
where S: Service<Req>,

Source§

fn with<T>(self, wrap: T) -> <T as Wrap<Self>>::Service
where Self: Sized, T: Wrap<Self>,

Source§

fn and_then<F>(self, f: F) -> AndThen<Self, F>
where Self: Sized,

Source§

fn then<F>(self, f: F) -> Then<Self, F>
where Self: Sized,

Source§

fn map_err<F>(self, f: F) -> MapErr<Self, F>
where Self: Sized,

Source§

fn map_future<F>(self, f: F) -> MapFuture<Self, F>
where Self: Sized,

Source§

fn map_request<F>(self, f: F) -> MapRequest<Self, F>
where Self: Sized,

Source§

fn map_response<F>(self, f: F) -> MapResponse<Self, F>
where Self: Sized,

Source§

fn map_result<F>(self, f: F) -> MapResult<Self, F>
where Self: Sized,

Source§

fn boxed(self) -> BoxService<Req, Self::Response, Self::Error>
where Self: Sized + 'static, Self::Future: 'static,

Source§

fn boxed_clone(self) -> BoxCloneService<Req, Self::Response, Self::Error>
where Self: Sized + Clone + 'static, Self::Future: 'static,

Source§

fn rc_boxed(self) -> RcService<Req, Self::Response, Self::Error>
where Self: Sized + 'static, Self::Future: 'static,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.