pub struct ServiceFn<F> { /* private fields */ }Expand description
将给定的异步函数转换为 Service。
Trait Implementations§
impl<F: Copy> Copy for ServiceFn<F>
Auto Trait Implementations§
impl<F> Freeze for ServiceFn<F>where
F: Freeze,
impl<F> RefUnwindSafe for ServiceFn<F>where
F: RefUnwindSafe,
impl<F> Send for ServiceFn<F>where
F: Send,
impl<F> Sync for ServiceFn<F>where
F: Sync,
impl<F> Unpin for ServiceFn<F>where
F: Unpin,
impl<F> UnwindSafe for ServiceFn<F>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S, Req> ServiceExt<Req> for S
impl<S, Req> ServiceExt<Req> for S
Source§fn map_result<F, Res, Err>(self, f: F) -> MapResult<Self, F>
fn map_result<F, Res, Err>(self, f: F) -> MapResult<Self, F>
将此服务返回的结果映射为其他值。 Read more
Source§fn map_response<F, Res>(self, f: F) -> MapResponse<Self, F>
fn map_response<F, Res>(self, f: F) -> MapResponse<Self, F>
将此服务返回的响应映射为其他值。 Read more
Source§fn map_request<F, R>(self, f: F) -> MapRequest<Self, F>
fn map_request<F, R>(self, f: F) -> MapRequest<Self, F>
将发送给此服务的请求映射为其他值。 Read more