Struct AndThen

Source
pub struct AndThen<S, F> { /* private fields */ }

Implementations§

Source§

impl<S, F> AndThen<S, F>

Source

pub fn new(inner: S, f: F) -> AndThen<S, F>

Trait Implementations§

Source§

impl<S, F> Clone for AndThen<S, F>
where S: Clone, F: Clone,

Source§

fn clone(&self) -> AndThen<S, F>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S, F> Debug for AndThen<S, F>
where S: Debug,

Source§

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

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

impl<S, F, Req, Res, Fut> Service<Req> for AndThen<S, F>
where S: Service<Req>, F: FnOnce(<S as Service<Req>>::Response) -> Fut + Clone, Fut: Future<Output = Result<Res, <S as Service<Req>>::Error>>,

Source§

type Response = Res

服务返回的响应。
Source§

type Error = <S as Service<Req>>::Error

服务产生的错误。
Source§

type Future = AndThenFuture<<S as Service<Req>>::Future, Fut, F>

异步返回的响应。
Source§

fn call(&self, request: Req) -> <AndThen<S, F> as Service<Req>>::Future

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

impl<S, F> Copy for AndThen<S, F>
where S: Copy, F: Copy,

Auto Trait Implementations§

§

impl<S, F> Freeze for AndThen<S, F>
where S: Freeze, F: Freeze,

§

impl<S, F> RefUnwindSafe for AndThen<S, F>

§

impl<S, F> Send for AndThen<S, F>
where S: Send, F: Send,

§

impl<S, F> Sync for AndThen<S, F>
where S: Sync, F: Sync,

§

impl<S, F> Unpin for AndThen<S, F>
where S: Unpin, F: Unpin,

§

impl<S, F> UnwindSafe for AndThen<S, F>
where S: UnwindSafe, F: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.