Trait libp2p::core::transport::Transport [−][src]
A transport provides connection-oriented communication between two peers through ordered streams of data (i.e. connections).
Connections are established either by listening
or dialing on a Transport
. A peer that
obtains a connection by listening is often referred to as the listener and the
peer that initiated the connection through dialing as the dialer, in
contrast to the traditional roles of server and client.
Most transports also provide a form of reliable delivery on the established connections but the precise semantics of these guarantees depend on the specific transport.
This trait is implemented for concrete connection-oriented transport protocols like TCP or Unix Domain Sockets, but also on wrappers that add additional functionality to the dialing or listening process (e.g. name resolution via the DNS).
Additional protocols can be layered on top of the connections established
by a Transport
through an upgrade mechanism that is initiated via
upgrade
.
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
[src]
The result of a connection setup process, including protocol upgrades.
Typically the output contains at least a handle to a data stream (i.e. a connection or a substream multiplexer on top of a connection) that provides APIs for sending and receiving data through the connection.
type Error: Error
[src]
An error that occurred during connection setup.
type Listener: Stream
[src]
A stream of Output
s for inbound connections.
An item should be produced whenever a connection is received at the lowest level of the
transport stack. The item must be a ListenerUpgrade
future
that resolves to an Output
value once all protocol upgrades
have been applied.
If this stream produces an error, it is considered fatal and the listener is killed. It
is possible to report non-fatal errors by producing a ListenerEvent::Error
.
type ListenerUpgrade: Future
[src]
A pending Output
for an inbound connection,
obtained from the Listener
stream.
After a connection has been accepted by the transport, it may need to go through
asynchronous post-processing (i.e. protocol upgrade negotiations). Such
post-processing should not block the Listener
from producing the next
connection, hence further connection setup proceeds asynchronously.
Once a ListenerUpgrade
future resolves it yields the Output
of the connection setup process.
type Dial: Future
[src]
Required methods
pub fn listen_on(
self,
addr: Multiaddr
) -> Result<Self::Listener, TransportError<Self::Error>>
[src]
self,
addr: Multiaddr
) -> Result<Self::Listener, TransportError<Self::Error>>
Listens on the given Multiaddr
, producing a stream of pending, inbound connections
and addresses this transport is listening on (cf. ListenerEvent
).
Returning an error from the stream is considered fatal. The listener can also report
non-fatal errors by producing a ListenerEvent::Error
.
pub fn dial(
self,
addr: Multiaddr
) -> Result<Self::Dial, TransportError<Self::Error>>
[src]
self,
addr: Multiaddr
) -> Result<Self::Dial, TransportError<Self::Error>>
Dials the given Multiaddr
, returning a future for a pending outbound connection.
If TransportError::MultiaddrNotSupported
is returned, it may be desirable to
try an alternative Transport
, if available.
Provided methods
pub 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,
[src]
Self: Clone + Send + Sync + 'static,
Self::Dial: Send,
Self::Dial: 'static,
Self::Listener: Send,
Self::Listener: 'static,
Self::ListenerUpgrade: Send,
Self::ListenerUpgrade: 'static,
Turns the transport into an abstract boxed (i.e. heap-allocated) transport.
pub fn map<F, O>(self, f: F) -> Map<Self, F> where
F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone,
[src]
F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone,
Applies a function on the connections created by the transport.
pub fn map_err<F, E>(self, f: F) -> MapErr<Self, F> where
F: FnOnce(Self::Error) -> E + Clone,
[src]
F: FnOnce(Self::Error) -> E + Clone,
Applies a function on the errors generated by the futures of the transport.
pub fn or_transport<U>(self, other: U) -> OrTransport<Self, U> where
U: Transport,
<U as Transport>::Error: 'static,
[src]
U: Transport,
<U as Transport>::Error: 'static,
Adds a fallback transport that is used when encountering errors while establishing inbound or outbound connections.
The returned transport will act like self
, except that if listen_on
or dial
return an error then other
will be tried.
pub fn and_then<C, F, O>(self, f: C) -> AndThen<Self, C> where
C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
F: TryFuture<Ok = O>,
<F as TryFuture>::Error: Error,
<F as TryFuture>::Error: 'static,
[src]
C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
F: TryFuture<Ok = O>,
<F as TryFuture>::Error: Error,
<F as TryFuture>::Error: 'static,
Applies a function producing an asynchronous result to every connection created by this transport.
This function can be used for ad-hoc protocol upgrades or for processing or adapting the output for following configurations.
For the high-level transport upgrade procedure, see Transport::upgrade
.
pub fn timeout(self, timeout: Duration) -> TransportTimeout<Self>
[src]
Adds a timeout to the connection setup (including upgrades) for all inbound and outbound connections established through the transport.
pub fn outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self>
[src]
Adds a timeout to the connection setup (including upgrades) for all outbound connections established through the transport.
pub fn inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self>
[src]
Adds a timeout to the connection setup (including upgrades) for all inbound connections established through the transport.
pub fn upgrade(self, version: Version) -> Builder<Self> where
Self::Error: 'static,
[src]
Self::Error: 'static,
Begins a series of protocol upgrades via an
upgrade::Builder
.
Implementors
impl Transport for MemoryTransport
[src]
type Output = RwStreamSink<Chan<Vec<u8, Global>>>
type Error = MemoryTransportError
type Listener = Listener
type ListenerUpgrade = Ready<Result<<MemoryTransport as Transport>::Output, <MemoryTransport as Transport>::Error>>
type Dial = DialFuture
pub fn listen_on(
self,
addr: Multiaddr
) -> Result<<MemoryTransport as Transport>::Listener, TransportError<<MemoryTransport as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<MemoryTransport as Transport>::Listener, TransportError<<MemoryTransport as Transport>::Error>>
pub fn dial(
self,
addr: Multiaddr
) -> Result<DialFuture, TransportError<<MemoryTransport as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<DialFuture, TransportError<<MemoryTransport as Transport>::Error>>
impl Transport for TcpConfig
[src]
type Output = TcpTransStream
type Error = Error
type Listener = Pin<Box<dyn Stream<Item = Result<ListenerEvent<<TcpConfig as Transport>::ListenerUpgrade, <TcpConfig as Transport>::Error>, <TcpConfig as Transport>::Error>> + 'static + Send, Global>>
type ListenerUpgrade = Ready<Result<<TcpConfig as Transport>::Output, <TcpConfig as Transport>::Error>>
type Dial = Pin<Box<dyn Future<Output = Result<TcpTransStream, Error>> + 'static + Send, Global>>
pub fn listen_on(
self,
addr: Multiaddr
) -> Result<<TcpConfig as Transport>::Listener, TransportError<<TcpConfig as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<TcpConfig as Transport>::Listener, TransportError<<TcpConfig as Transport>::Error>>
pub fn dial(
self,
addr: Multiaddr
) -> Result<<TcpConfig as Transport>::Dial, TransportError<<TcpConfig as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<TcpConfig as Transport>::Dial, TransportError<<TcpConfig as Transport>::Error>>
impl Transport for UdsConfig
[src]
type Output = UnixStream
type Error = Error
type Listener = Pin<Box<dyn Stream<Item = Result<ListenerEvent<<UdsConfig as Transport>::ListenerUpgrade, <UdsConfig as Transport>::Error>, <UdsConfig as Transport>::Error>> + 'static + Send, Global>>
type ListenerUpgrade = Ready<Result<<UdsConfig as Transport>::Output, <UdsConfig as Transport>::Error>>
type Dial = Pin<Box<dyn Future<Output = Result<<UdsConfig as Transport>::Output, <UdsConfig as Transport>::Error>> + 'static + Send, Global>>
pub fn listen_on(
self,
addr: Multiaddr
) -> Result<<UdsConfig as Transport>::Listener, TransportError<<UdsConfig as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<UdsConfig as Transport>::Listener, TransportError<<UdsConfig as Transport>::Error>>
pub fn dial(
self,
addr: Multiaddr
) -> Result<<UdsConfig as Transport>::Dial, TransportError<<UdsConfig as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<UdsConfig as Transport>::Dial, TransportError<<UdsConfig as Transport>::Error>>
impl Transport for ExtTransport
[src]
type Output = Connection
type Error = JsErr
type Listener = Listen
type ListenerUpgrade = Ready<Result<<ExtTransport as Transport>::Output, <ExtTransport as Transport>::Error>>
type Dial = Dial
pub fn listen_on(
self,
addr: Multiaddr
) -> Result<<ExtTransport as Transport>::Listener, TransportError<<ExtTransport as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<ExtTransport as Transport>::Listener, TransportError<<ExtTransport as Transport>::Error>>
pub fn dial(
self,
addr: Multiaddr
) -> Result<<ExtTransport as Transport>::Dial, TransportError<<ExtTransport as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<ExtTransport as Transport>::Dial, TransportError<<ExtTransport as Transport>::Error>>
impl<A, B> Transport for EitherTransport<A, B> where
A: Transport,
B: Transport,
[src]
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>
pub fn listen_on(
self,
addr: Multiaddr
) -> Result<<EitherTransport<A, B> as Transport>::Listener, TransportError<<EitherTransport<A, B> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<EitherTransport<A, B> as Transport>::Listener, TransportError<<EitherTransport<A, B> as Transport>::Error>>
pub fn dial(
self,
addr: Multiaddr
) -> Result<<EitherTransport<A, B> as Transport>::Dial, TransportError<<EitherTransport<A, B> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<EitherTransport<A, B> as Transport>::Dial, TransportError<<EitherTransport<A, B> as Transport>::Error>>
impl<A, B> Transport for OrTransport<A, B> where
A: Transport,
B: Transport,
[src]
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>
pub fn listen_on(
self,
addr: Multiaddr
) -> Result<<OrTransport<A, B> as Transport>::Listener, TransportError<<OrTransport<A, B> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<OrTransport<A, B> as Transport>::Listener, TransportError<<OrTransport<A, B> as Transport>::Error>>
pub fn dial(
self,
addr: Multiaddr
) -> Result<<OrTransport<A, B> as Transport>::Dial, TransportError<<OrTransport<A, B> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<OrTransport<A, B> as Transport>::Dial, TransportError<<OrTransport<A, B> as Transport>::Error>>
impl<InnerTrans> Transport for TransportTimeout<InnerTrans> where
InnerTrans: Transport,
<InnerTrans as Transport>::Error: 'static,
[src]
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 = Timeout<<InnerTrans as Transport>::ListenerUpgrade>
type Dial = Timeout<<InnerTrans as Transport>::Dial>
pub fn listen_on(
self,
addr: Multiaddr
) -> Result<<TransportTimeout<InnerTrans> as Transport>::Listener, TransportError<<TransportTimeout<InnerTrans> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<TransportTimeout<InnerTrans> as Transport>::Listener, TransportError<<TransportTimeout<InnerTrans> as Transport>::Error>>
pub fn dial(
self,
addr: Multiaddr
) -> Result<<TransportTimeout<InnerTrans> as Transport>::Dial, TransportError<<TransportTimeout<InnerTrans> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<TransportTimeout<InnerTrans> as Transport>::Dial, TransportError<<TransportTimeout<InnerTrans> as Transport>::Error>>
impl<O, E> Transport for Boxed<O, E> where
E: Error,
[src]
E: Error,
type Output = O
type Error = E
type Listener = Pin<Box<dyn Stream<Item = Result<ListenerEvent<Pin<Box<dyn Future<Output = Result<O, E>> + 'static + Send, Global>>, E>, E>> + 'static + Send, Global>>
type ListenerUpgrade = Pin<Box<dyn Future<Output = Result<O, E>> + 'static + Send, Global>>
type Dial = Pin<Box<dyn Future<Output = Result<O, E>> + 'static + Send, Global>>
pub fn listen_on(
self,
addr: Multiaddr
) -> Result<<Boxed<O, E> as Transport>::Listener, TransportError<<Boxed<O, E> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<Boxed<O, E> as Transport>::Listener, TransportError<<Boxed<O, E> as Transport>::Error>>
pub fn dial(
self,
addr: Multiaddr
) -> Result<<Boxed<O, E> as Transport>::Dial, TransportError<<Boxed<O, E> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<Boxed<O, E> as Transport>::Dial, TransportError<<Boxed<O, E> as Transport>::Error>>
impl<T> Transport for OptionalTransport<T> where
T: Transport,
[src]
T: Transport,
type Output = <T as Transport>::Output
type Error = <T as Transport>::Error
type Listener = <T as Transport>::Listener
type ListenerUpgrade = <T as Transport>::ListenerUpgrade
type Dial = <T as Transport>::Dial
pub fn listen_on(
self,
addr: Multiaddr
) -> Result<<OptionalTransport<T> as Transport>::Listener, TransportError<<OptionalTransport<T> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<OptionalTransport<T> as Transport>::Listener, TransportError<<OptionalTransport<T> as Transport>::Error>>
pub fn dial(
self,
addr: Multiaddr
) -> Result<<OptionalTransport<T> as Transport>::Dial, TransportError<<OptionalTransport<T> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<OptionalTransport<T> as Transport>::Dial, TransportError<<OptionalTransport<T> as Transport>::Error>>
impl<T> Transport for DnsConfig<T> where
T: Transport + Send + 'static,
<T as Transport>::Error: Send,
<T as Transport>::Dial: Send,
[src]
T: Transport + Send + 'static,
<T as Transport>::Error: Send,
<T as Transport>::Dial: Send,
type Output = <T as Transport>::Output
type Error = DnsErr<<T as Transport>::Error>
type Listener = MapErr<MapOk<<T as Transport>::Listener, fn(ListenerEvent<<T as Transport>::ListenerUpgrade, <T as Transport>::Error>) -> ListenerEvent<<DnsConfig<T> as Transport>::ListenerUpgrade, <DnsConfig<T> as Transport>::Error>>, 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>, Pin<Box<dyn Future<Output = Result<<DnsConfig<T> as Transport>::Output, <DnsConfig<T> as Transport>::Error>> + 'static + Send, Global>>>
pub fn listen_on(
self,
addr: Multiaddr
) -> Result<<DnsConfig<T> as Transport>::Listener, TransportError<<DnsConfig<T> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<DnsConfig<T> as Transport>::Listener, TransportError<<DnsConfig<T> as Transport>::Error>>
pub fn dial(
self,
addr: Multiaddr
) -> Result<<DnsConfig<T> as Transport>::Dial, TransportError<<DnsConfig<T> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<DnsConfig<T> as Transport>::Dial, TransportError<<DnsConfig<T> as Transport>::Error>>
impl<T> Transport for libp2p::websocket::framed::WsConfig<T> where
T: Transport + Send + Clone + 'static,
<T as Transport>::Error: Send,
<T as Transport>::Error: 'static,
<T as Transport>::Dial: Send,
<T as Transport>::Dial: 'static,
<T as Transport>::Listener: Send,
<T as Transport>::Listener: 'static,
<T as Transport>::ListenerUpgrade: Send,
<T as Transport>::ListenerUpgrade: 'static,
<T as Transport>::Output: AsyncRead,
<T as Transport>::Output: AsyncWrite,
<T as Transport>::Output: Unpin,
<T as Transport>::Output: Send,
<T as Transport>::Output: 'static,
[src]
T: Transport + Send + Clone + 'static,
<T as Transport>::Error: Send,
<T as Transport>::Error: 'static,
<T as Transport>::Dial: Send,
<T as Transport>::Dial: 'static,
<T as Transport>::Listener: Send,
<T as Transport>::Listener: 'static,
<T as Transport>::ListenerUpgrade: Send,
<T as Transport>::ListenerUpgrade: 'static,
<T as Transport>::Output: AsyncRead,
<T as Transport>::Output: AsyncWrite,
<T as Transport>::Output: Unpin,
<T as Transport>::Output: Send,
<T as Transport>::Output: 'static,
type Output = Connection<<T as Transport>::Output>
type Error = Error<<T as Transport>::Error>
type Listener = Pin<Box<dyn Stream<Item = Result<ListenerEvent<<WsConfig<T> as Transport>::ListenerUpgrade, <WsConfig<T> as Transport>::Error>, <WsConfig<T> as Transport>::Error>> + 'static + Send, Global>>
type ListenerUpgrade = Pin<Box<dyn Future<Output = Result<<WsConfig<T> as Transport>::Output, <WsConfig<T> as Transport>::Error>> + 'static + Send, Global>>
type Dial = Pin<Box<dyn Future<Output = Result<<WsConfig<T> as Transport>::Output, <WsConfig<T> as Transport>::Error>> + 'static + Send, Global>>
pub fn listen_on(
self,
addr: Multiaddr
) -> Result<<WsConfig<T> as Transport>::Listener, TransportError<<WsConfig<T> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<WsConfig<T> as Transport>::Listener, TransportError<<WsConfig<T> as Transport>::Error>>
pub fn dial(
self,
addr: Multiaddr
) -> Result<<WsConfig<T> as Transport>::Dial, TransportError<<WsConfig<T> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<WsConfig<T> as Transport>::Dial, TransportError<<WsConfig<T> as Transport>::Error>>
impl<T> Transport for libp2p::websocket::WsConfig<T> where
T: Transport + Send + Clone + 'static,
<T as Transport>::Error: Send,
<T as Transport>::Error: 'static,
<T as Transport>::Dial: Send,
<T as Transport>::Dial: 'static,
<T as Transport>::Listener: Send,
<T as Transport>::Listener: 'static,
<T as Transport>::ListenerUpgrade: Send,
<T as Transport>::ListenerUpgrade: 'static,
<T as Transport>::Output: AsyncRead,
<T as Transport>::Output: AsyncWrite,
<T as Transport>::Output: Unpin,
<T as Transport>::Output: Send,
<T as Transport>::Output: 'static,
[src]
T: Transport + Send + Clone + 'static,
<T as Transport>::Error: Send,
<T as Transport>::Error: 'static,
<T as Transport>::Dial: Send,
<T as Transport>::Dial: 'static,
<T as Transport>::Listener: Send,
<T as Transport>::Listener: 'static,
<T as Transport>::ListenerUpgrade: Send,
<T as Transport>::ListenerUpgrade: 'static,
<T as Transport>::Output: AsyncRead,
<T as Transport>::Output: AsyncWrite,
<T as Transport>::Output: Unpin,
<T as Transport>::Output: Send,
<T as Transport>::Output: 'static,
type Output = RwStreamSink<BytesConnection<<T as Transport>::Output>>
type Error = Error<<T as Transport>::Error>
type Listener = MapStream<Pin<Box<dyn Stream<Item = Result<ListenerEvent<Pin<Box<dyn Future<Output = Result<Connection<<T as Transport>::Output>, Error<<T as Transport>::Error>>> + 'static + Send, Global>>, Error<<T as Transport>::Error>>, Error<<T as Transport>::Error>>> + 'static + Send, Global>>, fn(Connection<<T as Transport>::Output>, ConnectedPoint) -> RwStreamSink<BytesConnection<<T as Transport>::Output>>>
type ListenerUpgrade = MapFuture<Pin<Box<dyn Future<Output = Result<Connection<<T as Transport>::Output>, Error<<T as Transport>::Error>>> + 'static + Send, Global>>, fn(Connection<<T as Transport>::Output>, ConnectedPoint) -> RwStreamSink<BytesConnection<<T as Transport>::Output>>>
type Dial = MapFuture<Pin<Box<dyn Future<Output = Result<Connection<<T as Transport>::Output>, Error<<T as Transport>::Error>>> + 'static + Send, Global>>, fn(Connection<<T as Transport>::Output>, ConnectedPoint) -> RwStreamSink<BytesConnection<<T as Transport>::Output>>>
pub fn listen_on(
self,
addr: Multiaddr
) -> Result<<WsConfig<T> as Transport>::Listener, TransportError<<WsConfig<T> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<WsConfig<T> as Transport>::Listener, TransportError<<WsConfig<T> as Transport>::Error>>
pub fn dial(
self,
addr: Multiaddr
) -> Result<<WsConfig<T> as Transport>::Dial, TransportError<<WsConfig<T> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<WsConfig<T> as Transport>::Dial, TransportError<<WsConfig<T> as Transport>::Error>>
impl<T, C, D, U, I, E> Transport for Upgrade<T, U> where
C: AsyncRead + AsyncWrite + Unpin,
E: Error + 'static,
T: Transport<Output = (I, C)>,
U: InboundUpgrade<Negotiated<C>, Output = D, Error = E> + OutboundUpgrade<Negotiated<C>, Output = D, Error = E> + Clone,
<T as Transport>::Error: 'static,
[src]
C: AsyncRead + AsyncWrite + Unpin,
E: Error + 'static,
T: Transport<Output = (I, C)>,
U: InboundUpgrade<Negotiated<C>, Output = D, Error = E> + OutboundUpgrade<Negotiated<C>, Output = D, Error = E> + Clone,
<T as Transport>::Error: 'static,
type Output = (I, D)
type Error = TransportUpgradeError<<T as Transport>::Error, E>
type Listener = ListenerStream<<T as Transport>::Listener, U>
type ListenerUpgrade = ListenerUpgradeFuture<<T as Transport>::ListenerUpgrade, U, I, C>
type Dial = DialUpgradeFuture<<T as Transport>::Dial, U, I, C>
pub fn dial(
self,
addr: Multiaddr
) -> Result<<Upgrade<T, U> as Transport>::Dial, TransportError<<Upgrade<T, U> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<Upgrade<T, U> as Transport>::Dial, TransportError<<Upgrade<T, U> as Transport>::Error>>
pub fn listen_on(
self,
addr: Multiaddr
) -> Result<<Upgrade<T, U> as Transport>::Listener, TransportError<<Upgrade<T, U> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<Upgrade<T, U> as Transport>::Listener, TransportError<<Upgrade<T, U> as Transport>::Error>>
impl<T, C, F, O> Transport for AndThen<T, C> where
C: FnOnce(<T as Transport>::Output, ConnectedPoint) -> F + Clone,
F: TryFuture<Ok = O>,
T: Transport,
<F as TryFuture>::Error: Error,
[src]
C: FnOnce(<T as Transport>::Output, ConnectedPoint) -> F + Clone,
F: TryFuture<Ok = O>,
T: Transport,
<F as TryFuture>::Error: Error,
type Output = O
type Error = EitherError<<T as Transport>::Error, <F as TryFuture>::Error>
type Listener = AndThenStream<<T as Transport>::Listener, C>
type ListenerUpgrade = AndThenFuture<<T as Transport>::ListenerUpgrade, C, F>
type Dial = AndThenFuture<<T as Transport>::Dial, C, F>
pub fn listen_on(
self,
addr: Multiaddr
) -> Result<<AndThen<T, C> as Transport>::Listener, TransportError<<AndThen<T, C> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<AndThen<T, C> as Transport>::Listener, TransportError<<AndThen<T, C> as Transport>::Error>>
pub fn dial(
self,
addr: Multiaddr
) -> Result<<AndThen<T, C> as Transport>::Dial, TransportError<<AndThen<T, C> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<AndThen<T, C> as Transport>::Dial, TransportError<<AndThen<T, C> as Transport>::Error>>
impl<T, F, D> Transport for Map<T, F> where
F: FnOnce(<T as Transport>::Output, ConnectedPoint) -> D + Clone,
T: Transport,
[src]
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>
pub fn listen_on(
self,
addr: Multiaddr
) -> Result<<Map<T, F> as Transport>::Listener, TransportError<<Map<T, F> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<Map<T, F> as Transport>::Listener, TransportError<<Map<T, F> as Transport>::Error>>
pub fn dial(
self,
addr: Multiaddr
) -> Result<<Map<T, F> as Transport>::Dial, TransportError<<Map<T, F> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<Map<T, F> as Transport>::Dial, TransportError<<Map<T, F> as Transport>::Error>>
impl<T, F, TErr> Transport for MapErr<T, F> where
TErr: Error,
F: FnOnce(<T as Transport>::Error) -> TErr + Clone,
T: Transport,
[src]
TErr: Error,
F: FnOnce(<T as Transport>::Error) -> TErr + Clone,
T: Transport,
type Output = <T as Transport>::Output
type Error = TErr
type Listener = MapErrListener<T, F>
type ListenerUpgrade = MapErrListenerUpgrade<T, F>
type Dial = MapErrDial<T, F>
pub fn listen_on(
self,
addr: Multiaddr
) -> Result<<MapErr<T, F> as Transport>::Listener, TransportError<<MapErr<T, F> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<MapErr<T, F> as Transport>::Listener, TransportError<<MapErr<T, F> as Transport>::Error>>
pub fn dial(
self,
addr: Multiaddr
) -> Result<<MapErr<T, F> as Transport>::Dial, TransportError<<MapErr<T, F> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<MapErr<T, F> as Transport>::Dial, TransportError<<MapErr<T, F> as Transport>::Error>>
impl<TInner> Transport for BandwidthLogging<TInner> where
TInner: Transport,
[src]
TInner: Transport,
type Output = BandwidthConnecLogging<TInner::Output>
type Error = TInner::Error
type Listener = BandwidthListener<TInner::Listener>
type ListenerUpgrade = BandwidthFuture<TInner::ListenerUpgrade>
type Dial = BandwidthFuture<TInner::Dial>
fn listen_on(
self,
addr: Multiaddr
) -> Result<Self::Listener, TransportError<Self::Error>>
[src]
self,
addr: Multiaddr
) -> Result<Self::Listener, TransportError<Self::Error>>
fn dial(
self,
addr: Multiaddr
) -> Result<Self::Dial, TransportError<Self::Error>>
[src]
self,
addr: Multiaddr
) -> Result<Self::Dial, TransportError<Self::Error>>
impl<TOut> Transport for DummyTransport<TOut>
[src]
type Output = TOut
type Error = Error
type Listener = Pending<Result<ListenerEvent<<DummyTransport<TOut> as Transport>::ListenerUpgrade, <DummyTransport<TOut> as Transport>::Error>, <DummyTransport<TOut> as Transport>::Error>>
type ListenerUpgrade = Pending<Result<<DummyTransport<TOut> as Transport>::Output, Error>>
type Dial = Pending<Result<<DummyTransport<TOut> as Transport>::Output, Error>>
pub fn listen_on(
self,
addr: Multiaddr
) -> Result<<DummyTransport<TOut> as Transport>::Listener, TransportError<<DummyTransport<TOut> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<DummyTransport<TOut> as Transport>::Listener, TransportError<<DummyTransport<TOut> as Transport>::Error>>
pub fn dial(
self,
addr: Multiaddr
) -> Result<<DummyTransport<TOut> as Transport>::Dial, TransportError<<DummyTransport<TOut> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<<DummyTransport<TOut> as Transport>::Dial, TransportError<<DummyTransport<TOut> as Transport>::Error>>