Trait libp2p::InboundUpgradeExt
source · [−]pub trait InboundUpgradeExt<C>: InboundUpgrade<C> {
fn map_inbound<F, T>(self, f: F) -> MapInboundUpgrade<Self, F>
where
F: FnOnce(Self::Output) -> T,
{ ... }
fn map_inbound_err<F, T>(self, f: F) -> MapInboundUpgradeErr<Self, F>
where
F: FnOnce(Self::Error) -> T,
{ ... }
}
Expand description
Extension trait for InboundUpgrade
. Automatically implemented on all types that implement
InboundUpgrade
.
Provided methods
fn map_inbound<F, T>(self, f: F) -> MapInboundUpgrade<Self, F> where
F: FnOnce(Self::Output) -> T,
fn map_inbound<F, T>(self, f: F) -> MapInboundUpgrade<Self, F> where
F: FnOnce(Self::Output) -> T,
Returns a new object that wraps around Self
and applies a closure to the Output
.
fn map_inbound_err<F, T>(self, f: F) -> MapInboundUpgradeErr<Self, F> where
F: FnOnce(Self::Error) -> T,
fn map_inbound_err<F, T>(self, f: F) -> MapInboundUpgradeErr<Self, F> where
F: FnOnce(Self::Error) -> T,
Returns a new object that wraps around Self
and applies a closure to the Error
.