Struct libp2p_maybe_transport::MaybeUpgrade [−][src]
pub struct MaybeUpgrade<TInner, TUpgrade, TUpgrader> { /* fields omitted */ }
Implementations
Trait Implementations
impl<TInner, TUpgrade, TUpgrader> Transport for MaybeUpgrade<TInner, TUpgrade, TUpgrader> where
TInner: Transport,
TUpgrade: Transport,
TUpgrader: UpgradeMaybe<TInner, TUpgrade> + Clone,
impl<TInner, TUpgrade, TUpgrader> Transport for MaybeUpgrade<TInner, TUpgrade, TUpgrader> where
TInner: Transport,
TUpgrade: Transport,
TUpgrader: UpgradeMaybe<TInner, TUpgrade> + Clone,
type Output = EitherOutput<TInner::Output, TUpgrade::Output>
type Output = EitherOutput<TInner::Output, TUpgrade::Output>
The result of a connection setup process, including protocol upgrades. Read more
type Error = TInner::Error
type Error = TInner::Error
An error that occurred during connection setup.
type ListenerUpgrade = AndThen<TInner::ListenerUpgrade, Then<TUpgrader::UpgradeFuture, Ready<Result<Self::Output, Self::Error>>, fn(_: Result<TUpgrade::Output, TInner::Output>) -> Ready<Result<Self::Output, Self::Error>>>, fn(_: TInner::Output) -> Then<TUpgrader::UpgradeFuture, Ready<Result<Self::Output, Self::Error>>, fn(_: Result<TUpgrade::Output, TInner::Output>) -> Ready<Result<Self::Output, Self::Error>>>>
type ListenerUpgrade = AndThen<TInner::ListenerUpgrade, Then<TUpgrader::UpgradeFuture, Ready<Result<Self::Output, Self::Error>>, fn(_: Result<TUpgrade::Output, TInner::Output>) -> Ready<Result<Self::Output, Self::Error>>>, fn(_: TInner::Output) -> Then<TUpgrader::UpgradeFuture, Ready<Result<Self::Output, Self::Error>>, fn(_: Result<TUpgrade::Output, TInner::Output>) -> Ready<Result<Self::Output, Self::Error>>>>
Listens on the given [Multiaddr
], producing a stream of pending, inbound connections
and addresses this transport is listening on (cf. [ListenerEvent
]). Read more
Dials the given [Multiaddr
], returning a future for a pending outbound connection. Read more
Performs a transport-specific mapping of an address observed
by
a remote onto a local listen
address to yield an address for
the local node that may be reachable for other peers. Read more
Boxes the transport, including custom transport errors.
Applies a function on the connections created by the transport.
Applies a function on the errors generated by the futures of the transport.
fn or_transport<U>(self, other: U) -> OrTransport<Self, U> where
U: Transport,
<U as Transport>::Error: 'static,
fn or_transport<U>(self, other: U) -> OrTransport<Self, U> where
U: Transport,
<U as Transport>::Error: 'static,
Adds a fallback transport that is used when encountering errors while establishing inbound or outbound connections. Read more
Applies a function producing an asynchronous result to every connection created by this transport. Read more
fn upgrade(self, version: Version) -> Builder<Self> where
Self::Error: 'static,
fn upgrade(self, version: Version) -> Builder<Self> where
Self::Error: 'static,
Begins a series of protocol upgrades via an
upgrade::Builder
. Read more
Auto Trait Implementations
impl<TInner, TUpgrade, TUpgrader> RefUnwindSafe for MaybeUpgrade<TInner, TUpgrade, TUpgrader> where
TInner: RefUnwindSafe,
TUpgrade: RefUnwindSafe,
TUpgrader: RefUnwindSafe,
impl<TInner, TUpgrade, TUpgrader> Send for MaybeUpgrade<TInner, TUpgrade, TUpgrader> where
TInner: Send,
TUpgrade: Send,
TUpgrader: Send,
impl<TInner, TUpgrade, TUpgrader> Sync for MaybeUpgrade<TInner, TUpgrade, TUpgrader> where
TInner: Sync,
TUpgrade: Sync,
TUpgrader: Sync,
impl<TInner, TUpgrade, TUpgrader> Unpin for MaybeUpgrade<TInner, TUpgrade, TUpgrader> where
TInner: Unpin,
TUpgrade: Unpin,
TUpgrader: Unpin,
impl<TInner, TUpgrade, TUpgrader> UnwindSafe for MaybeUpgrade<TInner, TUpgrade, TUpgrader> where
TInner: UnwindSafe,
TUpgrade: UnwindSafe,
TUpgrader: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self
Adds a layer on the Transport
that logs all trafic that passes through the sockets
created by it. Read more