pub struct Map<T, TMap> { /* private fields */ }Expand description
将 Transport 的输出使用函数映射到另一个类型。
Implementations§
Trait Implementations§
impl<T: Copy, TMap: Copy> Copy for Map<T, TMap>
Source§impl<T, TMap, O> Transport for Map<T, TMap>
impl<T, TMap, O> Transport for Map<T, TMap>
type Output = O
type Error = <T as Transport>::Error
type ListenerUpgrade = MapFuture<<T as Transport>::ListenerUpgrade, TMap>
type Dialer = MapFuture<<T as Transport>::Dialer, TMap>
type Listener = MapListener<T, TMap>
fn connect(&self, addr: SocketAddr) -> Result<Self::Dialer, Self::Error>
fn listen(&self, addr: SocketAddr) -> Result<Self::Listener, Self::Error>
fn map<F, O>(self, f: F) -> Map<Self, F>
fn and_then<TMap, TFut, O>(self, f: TMap) -> AndThen<Self, TMap>
fn map_err<F, O>(self, f: F) -> MapErr<Self, F>
fn upgrade(self) -> Builder<Self>
impl<'pin, T, TMap> Unpin for Map<T, TMap>where
PinnedFieldsOf<__Map<'pin, T, TMap>>: Unpin,
Auto Trait Implementations§
impl<T, TMap> Freeze for Map<T, TMap>
impl<T, TMap> RefUnwindSafe for Map<T, TMap>where
T: RefUnwindSafe,
TMap: RefUnwindSafe,
impl<T, TMap> Send for Map<T, TMap>
impl<T, TMap> Sync for Map<T, TMap>
impl<T, TMap> UnsafeUnpin for Map<T, TMap>where
T: UnsafeUnpin,
TMap: UnsafeUnpin,
impl<T, TMap> UnwindSafe for Map<T, TMap>where
T: UnwindSafe,
TMap: 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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more