[−][src]Trait libp2p::Transport
A transport is an object that can be used to produce connections by listening or dialing a peer.
This trait is implemented on concrete transports (e.g. TCP, UDP, etc.), but also on wrappers around them.
Note: The methods of this trait use
self
and not&self
or&mut self
. In other words, listening or dialing consumes the transport object. This has been designed so that you would implement this trait on&Foo
or&mut Foo
instead of directly onFoo
.
Associated Types
type Output
The raw connection to a peer.
type Error: Error
Error that can happen when dialing or listening.
type Listener: Stream
The listener produces incoming connections.
An item should be produced whenever a connection is received at the lowest level of the
transport stack. The item is a Future
that is signalled once some pre-processing has
taken place, and that connection has been upgraded to the wanted protocols.
type ListenerUpgrade: Future
After a connection has been received, we may need to do some asynchronous pre-processing on it (e.g. an intermediary protocol negotiation). While this pre-processing takes place, we want to be able to continue polling on the listener.
type Dial: Future
A future which indicates that we are currently dialing to a peer.
Required methods
fn listen_on(
self,
addr: Multiaddr
) -> Result<(Self::Listener, Multiaddr), TransportError<Self::Error>>
self,
addr: Multiaddr
) -> Result<(Self::Listener, Multiaddr), TransportError<Self::Error>>
Listen on the given multiaddr. Returns a stream of incoming connections, plus a modified
version of the Multiaddr
. This new Multiaddr
is the one that that should be advertised
to other nodes, instead of the one passed as parameter.
Note: The reason why we need to change the
Multiaddr
on success is to handle situations such as turning/ip4/127.0.0.1/tcp/0
into/ip4/127.0.0.1/tcp/<actual port>
.
fn dial(
self,
addr: Multiaddr
) -> Result<Self::Dial, TransportError<Self::Error>>
self,
addr: Multiaddr
) -> Result<Self::Dial, TransportError<Self::Error>>
Dial the given multi-addr.
Returns either a future which may resolve to a connection.
If MultiaddrNotSupported
is returned, then caller can try another implementation of
Transport
if there is any. If instead an error is returned, then we assume that there is
no point in trying another Transport
.
fn nat_traversal(
&self,
server: &Multiaddr,
observed: &Multiaddr
) -> Option<Multiaddr>
&self,
server: &Multiaddr,
observed: &Multiaddr
) -> Option<Multiaddr>
Takes a multiaddress we're listening on (server
), and tries to convert it to an
externally-visible multiaddress. In order to do so, we pass an observed
address which
a remote node observes for one of our dialers.
For example, if server
is /ip4/0.0.0.0/tcp/3000
and observed
is
/ip4/80.81.82.83/tcp/29601
, then we should return /ip4/80.81.82.83/tcp/3000
.
Each implementation of Transport
is only responsible for handling the protocols it
supports and should only consider the prefix of observed
necessary to perform the
address translation (e.g. /ip4/80.81.82.83
) but should otherwise preserve server
as is.
Returns None
if nothing can be determined. This happens if this trait implementation
doesn't recognize the protocols, or if server
and observed
are not related.
Provided methods
fn boxed(self) -> Boxed<Self::Output, Self::Error> where
Self: Clone + Send + Sync + 'static,
Self::Dial: Send,
Self::Dial: 'static,
Self::Listener: Send,
Self::Listener: 'static,
Self::ListenerUpgrade: Send,
Self::ListenerUpgrade: 'static,
Self: Clone + Send + Sync + 'static,
Self::Dial: Send,
Self::Dial: 'static,
Self::Listener: Send,
Self::Listener: 'static,
Self::ListenerUpgrade: Send,
Self::ListenerUpgrade: 'static,
Turns this Transport
into an abstract boxed transport.
fn map<F, O>(self, map: F) -> Map<Self, F> where
F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone,
F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone,
Applies a function on the output of the Transport
.
fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where
F: FnOnce(Self::Error) -> TNewErr + Clone,
F: FnOnce(Self::Error) -> TNewErr + Clone,
Applies a function on the errors generated by the futures of the Transport
.
fn or_transport<T>(self, other: T) -> OrTransport<Self, T>
Builds a new struct that implements Transport
that contains both self
and other
.
The returned object will redirect its calls to self
, except that if listen_on
or dial
return an error then other
will be tried.
fn with_upgrade<U, O, E>(self, upgrade: U) -> Upgrade<Self, U> where
U: InboundUpgrade<Self::Output, Output = O, Error = E> + OutboundUpgrade<Self::Output, Output = O, Error = E>,
Self::Output: AsyncRead,
Self::Output: AsyncWrite,
U: InboundUpgrade<Self::Output, Output = O, Error = E> + OutboundUpgrade<Self::Output, Output = O, Error = E>,
Self::Output: AsyncRead,
Self::Output: AsyncWrite,
Wraps this transport inside an upgrade. Whenever a connection that uses this transport is established, it is wrapped inside the upgrade.
Note: The concept of an upgrade for example includes middlewares such secio (communication encryption), multiplex, but also a protocol handler.
fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where
C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
F: IntoFuture<Item = O>,
C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
F: IntoFuture<Item = O>,
Wraps this transport inside an upgrade. Whenever a connection that uses this transport is established, it is wrapped inside the upgrade.
Note: The concept of an upgrade for example includes middlewares such secio (communication encryption), multiplex, but also a protocol handler.
fn with_timeout(self, timeout: Duration) -> TransportTimeout<Self>
Adds a timeout to the connection and upgrade steps for all the sockets created by the transport.
fn with_outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self>
Adds a timeout to the connection and upgrade steps for all the outgoing sockets created by the transport.
fn with_inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self>
Adds a timeout to the connection and upgrade steps for all the incoming sockets created by the transport.
Implementors
impl Transport for TcpConfig
[src]
impl Transport for TcpConfig
type Output = TcpTransStream
type Error = Error
type Listener = TcpListenStream
type ListenerUpgrade = FutureResult<<TcpConfig as Transport>::Output, Error>
type Dial = TcpDialFut
fn listen_on( | [src] |
fn dial( | [src] |
fn nat_traversal( | [src] |
fn boxed(self) -> Boxed<Self::Output, Self::Error> where | [src] |
fn map<F, O>(self, map: F) -> Map<Self, F> where | [src] |
fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where | [src] |
fn or_transport<T>(self, other: T) -> OrTransport<Self, T> | [src] |
fn with_upgrade<U, O, E>(self, upgrade: U) -> Upgrade<Self, U> where | [src] |
fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where | [src] |
fn with_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
impl Transport for UdsConfig
[src]
impl Transport for UdsConfig
type Output = UnixStream
type Error = Error
type Listener = ListenerStream<Incoming>
type ListenerUpgrade = FutureResult<<UdsConfig as Transport>::Output, Error>
type Dial = ConnectFuture
fn listen_on( | [src] |
fn dial( | [src] |
fn nat_traversal( | [src] |
fn boxed(self) -> Boxed<Self::Output, Self::Error> where | [src] |
fn map<F, O>(self, map: F) -> Map<Self, F> where | [src] |
fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where | [src] |
fn or_transport<T>(self, other: T) -> OrTransport<Self, T> | [src] |
fn with_upgrade<U, O, E>(self, upgrade: U) -> Upgrade<Self, U> where | [src] |
fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where | [src] |
fn with_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
impl<A, B> Transport for OrTransport<A, B> where
A: Transport,
B: Transport,
[src]
impl<A, B> Transport for OrTransport<A, B> where
A: Transport,
B: Transport,
type Output = EitherOutput<<A as Transport>::Output, <B as Transport>::Output>
type Error = EitherError<<A as Transport>::Error, <B as Transport>::Error>
type Listener = EitherListenStream<<A as Transport>::Listener, <B as Transport>::Listener>
type ListenerUpgrade = EitherFuture<<A as Transport>::ListenerUpgrade, <B as Transport>::ListenerUpgrade>
type Dial = EitherFuture<<A as Transport>::Dial, <B as Transport>::Dial>
fn listen_on( | [src] |
fn dial( | [src] |
fn nat_traversal( | [src] |
fn boxed(self) -> Boxed<Self::Output, Self::Error> where | [src] |
fn map<F, O>(self, map: F) -> Map<Self, F> where | [src] |
fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where | [src] |
fn or_transport<T>(self, other: T) -> OrTransport<Self, T> | [src] |
fn with_upgrade<U, O, E>(self, upgrade: U) -> Upgrade<Self, U> where | [src] |
fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where | [src] |
fn with_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
impl<D, U, O, TUpgrErr> Transport for Upgrade<D, U> where
D: Transport,
TUpgrErr: Error + Send + Sync + 'static,
U: InboundUpgrade<<D as Transport>::Output, Output = O, Error = TUpgrErr> + OutboundUpgrade<<D as Transport>::Output, Output = O, Error = TUpgrErr> + Clone,
<D as Transport>::Output: AsyncRead,
<D as Transport>::Output: AsyncWrite,
<D as Transport>::Error: 'static,
[src]
impl<D, U, O, TUpgrErr> Transport for Upgrade<D, U> where
D: Transport,
TUpgrErr: Error + Send + Sync + 'static,
U: InboundUpgrade<<D as Transport>::Output, Output = O, Error = TUpgrErr> + OutboundUpgrade<<D as Transport>::Output, Output = O, Error = TUpgrErr> + Clone,
<D as Transport>::Output: AsyncRead,
<D as Transport>::Output: AsyncWrite,
<D as Transport>::Error: 'static,
type Output = O
type Error = TransportUpgradeError<<D as Transport>::Error, TUpgrErr>
type Listener = ListenerStream<<D as Transport>::Listener, U>
type ListenerUpgrade = ListenerUpgradeFuture<<D as Transport>::ListenerUpgrade, U>
type Dial = DialUpgradeFuture<<D as Transport>::Dial, U>
fn dial( | [src] |
fn listen_on( | [src] |
fn nat_traversal( | [src] |
fn boxed(self) -> Boxed<Self::Output, Self::Error> where | [src] |
fn map<F, O>(self, map: F) -> Map<Self, F> where | [src] |
fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where | [src] |
fn or_transport<T>(self, other: T) -> OrTransport<Self, T> | [src] |
fn with_upgrade<U, O, E>(self, upgrade: U) -> Upgrade<Self, U> where | [src] |
fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where | [src] |
fn with_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
impl<InnerTrans> Transport for TransportTimeout<InnerTrans> where
InnerTrans: Transport,
<InnerTrans as Transport>::Error: 'static,
[src]
impl<InnerTrans> Transport for TransportTimeout<InnerTrans> where
InnerTrans: Transport,
<InnerTrans as Transport>::Error: 'static,
type Output = <InnerTrans as Transport>::Output
type Error = TransportTimeoutError<<InnerTrans as Transport>::Error>
type Listener = TimeoutListener<<InnerTrans as Transport>::Listener>
type ListenerUpgrade = TokioTimerMapErr<Timeout<<InnerTrans as Transport>::ListenerUpgrade>>
type Dial = TokioTimerMapErr<Timeout<<InnerTrans as Transport>::Dial>>
fn listen_on( | [src] |
fn dial( | [src] |
fn nat_traversal( | [src] |
fn boxed(self) -> Boxed<Self::Output, Self::Error> where | [src] |
fn map<F, O>(self, map: F) -> Map<Self, F> where | [src] |
fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where | [src] |
fn or_transport<T>(self, other: T) -> OrTransport<Self, T> | [src] |
fn with_upgrade<U, O, E>(self, upgrade: U) -> Upgrade<Self, U> where | [src] |
fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where | [src] |
fn with_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
impl<O, E> Transport for Boxed<O, E> where
E: Error,
[src]
impl<O, E> Transport for Boxed<O, E> where
E: Error,
type Output = O
type Error = E
type Listener = Box<dyn Stream<Item = (Box<dyn Future<Item = O, Error = E> + 'static + Send>, Multiaddr), Error = E> + 'static + Send>
type ListenerUpgrade = Box<dyn Future<Item = O, Error = E> + 'static + Send>
type Dial = Box<dyn Future<Item = O, Error = E> + 'static + Send>
fn listen_on( | [src] |
fn dial( | [src] |
fn nat_traversal( | [src] |
fn boxed(self) -> Boxed<Self::Output, Self::Error> where | [src] |
fn map<F, O>(self, map: F) -> Map<Self, F> where | [src] |
fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where | [src] |
fn or_transport<T>(self, other: T) -> OrTransport<Self, T> | [src] |
fn with_upgrade<U, O, E>(self, upgrade: U) -> Upgrade<Self, U> where | [src] |
fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where | [src] |
fn with_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
impl<T> Transport for Dialer<T> where
T: 'static + Send + IntoBuf,
[src]
impl<T> Transport for Dialer<T> where
T: 'static + Send + IntoBuf,
type Output = RwStreamSink<Chan<T>>
type Error = MemoryTransportError
type Listener = Box<dyn Stream<Item = (<Dialer<T> as Transport>::ListenerUpgrade, Multiaddr), Error = MemoryTransportError> + 'static + Send>
type ListenerUpgrade = FutureResult<<Dialer<T> as Transport>::Output, MemoryTransportError>
type Dial = Box<dyn Future<Item = <Dialer<T> as Transport>::Output, Error = MemoryTransportError> + 'static + Send>
fn listen_on( | [src] |
fn dial( | [src] |
fn nat_traversal( | [src] |
fn boxed(self) -> Boxed<Self::Output, Self::Error> where | [src] |
fn map<F, O>(self, map: F) -> Map<Self, F> where | [src] |
fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where | [src] |
fn or_transport<T>(self, other: T) -> OrTransport<Self, T> | [src] |
fn with_upgrade<U, O, E>(self, upgrade: U) -> Upgrade<Self, U> where | [src] |
fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where | [src] |
fn with_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
impl<T> Transport for Listener<T> where
T: 'static + Send + IntoBuf,
[src]
impl<T> Transport for Listener<T> where
T: 'static + Send + IntoBuf,
type Output = RwStreamSink<Chan<T>>
type Error = MemoryTransportError
type Listener = Box<dyn Stream<Item = (<Listener<T> as Transport>::ListenerUpgrade, Multiaddr), Error = MemoryTransportError> + 'static + Send>
type ListenerUpgrade = FutureResult<<Listener<T> as Transport>::Output, MemoryTransportError>
type Dial = Box<dyn Future<Item = <Listener<T> as Transport>::Output, Error = MemoryTransportError> + 'static + Send>
fn listen_on( | [src] |
fn dial( | [src] |
fn nat_traversal( | [src] |
fn boxed(self) -> Boxed<Self::Output, Self::Error> where | [src] |
fn map<F, O>(self, map: F) -> Map<Self, F> where | [src] |
fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where | [src] |
fn or_transport<T>(self, other: T) -> OrTransport<Self, T> | [src] |
fn with_upgrade<U, O, E>(self, upgrade: U) -> Upgrade<Self, U> where | [src] |
fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where | [src] |
fn with_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
impl<T> Transport for DnsConfig<T> where
T: Transport,
<T as Transport>::Error: 'static,
[src]
impl<T> Transport for DnsConfig<T> where
T: Transport,
<T as Transport>::Error: 'static,
type Output = <T as Transport>::Output
type Error = DnsErr<<T as Transport>::Error>
type Listener = MapErr<Map<<T as Transport>::Listener, fn((<T as Transport>::ListenerUpgrade, Multiaddr)) -> (<DnsConfig<T> as Transport>::ListenerUpgrade, Multiaddr)>, fn(<T as Transport>::Error) -> <DnsConfig<T> as Transport>::Error>
type ListenerUpgrade = MapErr<<T as Transport>::ListenerUpgrade, fn(<T as Transport>::Error) -> <DnsConfig<T> as Transport>::Error>
type Dial = Either<MapErr<<T as Transport>::Dial, fn(<T as Transport>::Error) -> <DnsConfig<T> as Transport>::Error>, DialFuture<T, JoinFuture<JoinAll<IntoIter<Either<ResolveFuture<Box<dyn Future<Item = Vec<IpAddr>, Error = Error> + 'static + Send>, <T as Transport>::Error>, FutureResult<Protocol<'static>, <DnsConfig<T> as Transport>::Error>>>>>>>
fn listen_on( | [src] |
fn dial( | [src] |
fn nat_traversal( | [src] |
fn boxed(self) -> Boxed<Self::Output, Self::Error> where | [src] |
fn map<F, O>(self, map: F) -> Map<Self, F> where | [src] |
fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where | [src] |
fn or_transport<T>(self, other: T) -> OrTransport<Self, T> | [src] |
fn with_upgrade<U, O, E>(self, upgrade: U) -> Upgrade<Self, U> where | [src] |
fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where | [src] |
fn with_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
impl<T> Transport for RateLimited<T> where
T: Transport,
<T as Transport>::Output: AsyncRead,
<T as Transport>::Output: AsyncWrite,
<T as Transport>::Error: 'static,
[src]
impl<T> Transport for RateLimited<T> where
T: Transport,
<T as Transport>::Output: AsyncRead,
<T as Transport>::Output: AsyncWrite,
<T as Transport>::Error: 'static,
type Output = Connection<<T as Transport>::Output>
type Error = RateLimitedErr<<T as Transport>::Error>
type Listener = Listener<T>
type ListenerUpgrade = ListenerUpgrade<T>
type Dial = DialFuture<<T as Transport>::Dial>
fn listen_on( | [src] |
fn dial( | [src] |
fn nat_traversal( | [src] |
fn boxed(self) -> Boxed<Self::Output, Self::Error> where | [src] |
fn map<F, O>(self, map: F) -> Map<Self, F> where | [src] |
fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where | [src] |
fn or_transport<T>(self, other: T) -> OrTransport<Self, T> | [src] |
fn with_upgrade<U, O, E>(self, upgrade: U) -> Upgrade<Self, U> where | [src] |
fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where | [src] |
fn with_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
impl<T> Transport for WsConfig<T> where
T: Transport + 'static,
<T as Transport>::Error: Send,
<T as Transport>::Dial: Send,
<T as Transport>::Listener: Send,
<T as Transport>::ListenerUpgrade: Send,
<T as Transport>::Output: AsyncRead,
<T as Transport>::Output: AsyncWrite,
<T as Transport>::Output: Send,
[src]
impl<T> Transport for WsConfig<T> where
T: Transport + 'static,
<T as Transport>::Error: Send,
<T as Transport>::Dial: Send,
<T as Transport>::Listener: Send,
<T as Transport>::ListenerUpgrade: Send,
<T as Transport>::Output: AsyncRead,
<T as Transport>::Output: AsyncWrite,
<T as Transport>::Output: Send,
type Output = Box<dyn Stream + 'static + Send>
type Error = WsError<<T as Transport>::Error>
type Listener = Box<dyn Stream<Item = (<WsConfig<T> as Transport>::ListenerUpgrade, Multiaddr), Error = <WsConfig<T> as Transport>::Error> + 'static + Send>
type ListenerUpgrade = Box<dyn Future<Item = <WsConfig<T> as Transport>::Output, Error = <WsConfig<T> as Transport>::Error> + 'static + Send>
type Dial = Box<dyn Future<Item = <WsConfig<T> as Transport>::Output, Error = <WsConfig<T> as Transport>::Error> + 'static + Send>
fn listen_on( | [src] |
fn dial( | [src] |
fn nat_traversal( | [src] |
fn boxed(self) -> Boxed<Self::Output, Self::Error> where | [src] |
fn map<F, O>(self, map: F) -> Map<Self, F> where | [src] |
fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where | [src] |
fn or_transport<T>(self, other: T) -> OrTransport<Self, T> | [src] |
fn with_upgrade<U, O, E>(self, upgrade: U) -> Upgrade<Self, U> where | [src] |
fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where | [src] |
fn with_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
impl<T, C, F, O> Transport for AndThen<T, C> where
C: FnOnce(<T as Transport>::Output, ConnectedPoint) -> F + Clone,
F: IntoFuture<Item = O>,
T: Transport,
<F as IntoFuture>::Error: Error,
[src]
impl<T, C, F, O> Transport for AndThen<T, C> where
C: FnOnce(<T as Transport>::Output, ConnectedPoint) -> F + Clone,
F: IntoFuture<Item = O>,
T: Transport,
<F as IntoFuture>::Error: Error,
type Output = O
type Error = EitherError<<T as Transport>::Error, <F as IntoFuture>::Error>
type Listener = AndThenStream<<T as Transport>::Listener, C>
type ListenerUpgrade = AndThenFuture<<T as Transport>::ListenerUpgrade, C, <F as IntoFuture>::Future>
type Dial = AndThenFuture<<T as Transport>::Dial, C, <F as IntoFuture>::Future>
fn listen_on( | [src] |
fn dial( | [src] |
fn nat_traversal( | [src] |
fn boxed(self) -> Boxed<Self::Output, Self::Error> where | [src] |
fn map<F, O>(self, map: F) -> Map<Self, F> where | [src] |
fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where | [src] |
fn or_transport<T>(self, other: T) -> OrTransport<Self, T> | [src] |
fn with_upgrade<U, O, E>(self, upgrade: U) -> Upgrade<Self, U> where | [src] |
fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where | [src] |
fn with_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
impl<T, F, D> Transport for Map<T, F> where
F: FnOnce(<T as Transport>::Output, ConnectedPoint) -> D + Clone,
T: Transport,
[src]
impl<T, F, D> Transport for Map<T, F> where
F: FnOnce(<T as Transport>::Output, ConnectedPoint) -> D + Clone,
T: Transport,
type Output = D
type Error = <T as Transport>::Error
type Listener = MapStream<<T as Transport>::Listener, F>
type ListenerUpgrade = MapFuture<<T as Transport>::ListenerUpgrade, F>
type Dial = MapFuture<<T as Transport>::Dial, F>
fn listen_on( | [src] |
fn dial( | [src] |
fn nat_traversal( | [src] |
fn boxed(self) -> Boxed<Self::Output, Self::Error> where | [src] |
fn map<F, O>(self, map: F) -> Map<Self, F> where | [src] |
fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where | [src] |
fn or_transport<T>(self, other: T) -> OrTransport<Self, T> | [src] |
fn with_upgrade<U, O, E>(self, upgrade: U) -> Upgrade<Self, U> where | [src] |
fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where | [src] |
fn with_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
impl<T, F, TErr> Transport for MapErr<T, F> where
F: FnOnce(<T as Transport>::Error) -> TErr + Clone,
T: Transport,
TErr: Error,
[src]
impl<T, F, TErr> Transport for MapErr<T, F> where
F: FnOnce(<T as Transport>::Error) -> TErr + Clone,
T: Transport,
TErr: Error,
type Output = <T as Transport>::Output
type Error = TErr
type Listener = MapErrListener<T, F>
type ListenerUpgrade = MapErrListenerUpgrade<T, F>
type Dial = MapErrDial<T, F>
fn listen_on( | [src] |
fn dial( | [src] |
fn nat_traversal( | [src] |
fn boxed(self) -> Boxed<Self::Output, Self::Error> where | [src] |
fn map<F, O>(self, map: F) -> Map<Self, F> where | [src] |
fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where | [src] |
fn or_transport<T>(self, other: T) -> OrTransport<Self, T> | [src] |
fn with_upgrade<U, O, E>(self, upgrade: U) -> Upgrade<Self, U> where | [src] |
fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where | [src] |
fn with_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
impl<TTrans, TMuxer> Transport for IdentifyTransport<TTrans> where
TMuxer: StreamMuxer + Send + Sync + 'static,
TTrans: Transport<Output = TMuxer>,
<TTrans as Transport>::Error: 'static,
<TMuxer as StreamMuxer>::Substream: Send,
<TMuxer as StreamMuxer>::Substream: Sync,
<TMuxer as StreamMuxer>::Substream: 'static,
[src]
impl<TTrans, TMuxer> Transport for IdentifyTransport<TTrans> where
TMuxer: StreamMuxer + Send + Sync + 'static,
TTrans: Transport<Output = TMuxer>,
<TTrans as Transport>::Error: 'static,
<TMuxer as StreamMuxer>::Substream: Send,
<TMuxer as StreamMuxer>::Substream: Sync,
<TMuxer as StreamMuxer>::Substream: 'static,
type Output = (PeerId, TMuxer)
type Error = TransportUpgradeError<<TTrans as Transport>::Error, Error>
type Listener = Empty<(<IdentifyTransport<TTrans> as Transport>::ListenerUpgrade, Multiaddr), <IdentifyTransport<TTrans> as Transport>::Error>
type ListenerUpgrade = Empty<<IdentifyTransport<TTrans> as Transport>::Output, <IdentifyTransport<TTrans> as Transport>::Error>
type Dial = AndThen<MapErr<<TTrans as Transport>::Dial, fn(<TTrans as Transport>::Error) -> <IdentifyTransport<TTrans> as Transport>::Error>, MapErr<IdRetriever<TMuxer>, fn(UpgradeError<Error>) -> <IdentifyTransport<TTrans> as Transport>::Error>, fn(TMuxer) -> MapErr<IdRetriever<TMuxer>, fn(UpgradeError<Error>) -> <IdentifyTransport<TTrans> as Transport>::Error>>
fn listen_on( | [src] |
fn dial( | [src] |
fn nat_traversal(&self, a: &Multiaddr, b: &Multiaddr) -> Option<Multiaddr> | [src] |
fn boxed(self) -> Boxed<Self::Output, Self::Error> where | [src] |
fn map<F, O>(self, map: F) -> Map<Self, F> where | [src] |
fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where | [src] |
fn or_transport<T>(self, other: T) -> OrTransport<Self, T> | [src] |
fn with_upgrade<U, O, E>(self, upgrade: U) -> Upgrade<Self, U> where | [src] |
fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where | [src] |
fn with_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |
fn with_inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> | [src] |