[][src]Trait susyp2p::Transport

pub trait Transport where
    <Self::Listener as Stream>::Item == ListenerEvent<Self::ListenerUpgrade>,
    <Self::Listener as Stream>::Error == Self::Error,
    <Self::ListenerUpgrade as Future>::Item == Self::Output,
    <Self::ListenerUpgrade as Future>::Error == Self::Error,
    <Self::Dial as Future>::Item == Self::Output,
    <Self::Dial as Future>::Error == Self::Error
{ type Output; type Error: Error; type Listener: Stream; type ListenerUpgrade: Future; type Dial: Future; fn listen_on(
        self,
        addr: Multiaddr
    ) -> Result<Self::Listener, TransportError<Self::Error>>;
fn dial(
        self,
        addr: Multiaddr
    ) -> Result<Self::Dial, TransportError<Self::Error>>; 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
, { ... }
fn map<F, O>(self, map: F) -> Map<Self, F>
    where
        F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone
, { ... }
fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F>
    where
        F: FnOnce(Self::Error) -> TNewErr + Clone
, { ... }
fn or_transport<T>(self, other: T) -> OrTransport<Self, T> { ... }
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
, { ... }
fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C>
    where
        C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
        F: IntoFuture<Item = O>
, { ... }
fn with_timeout(self, timeout: Duration) -> TransportTimeout<Self> { ... }
fn with_outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> { ... }
fn with_inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> { ... } }

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 with_upgrade and optionally followed by further upgrades through chaining calls to with_upgrade and and_then. Thereby every upgrade yields a new Transport whose connection setup incorporates all earlier upgrades followed by the new upgrade, i.e. the order of the upgrades is significant.

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 on Foo.

Associated Types

type Output

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

An error that occurred during connection setup.

type Listener: Stream

A stream of Outputs 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.

type ListenerUpgrade: Future

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

A pending Output for an outbound connection, obtained from dialing.

Loading content...

Required methods

fn listen_on(
    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]).

fn dial(
    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.

Loading content...

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, 

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

Applies a function on the connections created by the transport.

fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where
    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 transport that falls back to another transport when encountering errors on dialing or listening for connections.

The returned transport will act like 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

Wraps this transport inside an [Upgrade].

Whenever an inbound or outbound connection is established by this transport, the upgrade is applied on the current state of the connection (which may have already gone through previous upgrades) as an [upgrade::InboundUpgrade] or [upgrade::OutboundUpgrade], respectively.

fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where
    C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
    F: IntoFuture<Item = O>, 

Applies a function producing an asynchronous result to every connection created by this transport.

This function can be used for ad-hoc protocol upgrades on a transport or for processing or adapting the output of an earlier upgrade before applying the next upgrade.

fn with_timeout(self, timeout: Duration) -> TransportTimeout<Self>

Adds a timeout to the connection setup (including upgrades) for all inbound and outbound connection attempts.

fn with_outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self>

Adds a timeout to the connection setup (including upgrades) for all outbound connection attempts.

fn with_inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self>

Adds a timeout to the connection setup (including upgrades) for all inbound connection attempts.

Loading content...

Implementors

impl Transport for MemoryTransport[src]

type Output = RwStreamSink<Chan<Bytes>>

type Error = MemoryTransportError

type Listener = Listener

type ListenerUpgrade = FutureResult<<MemoryTransport as Transport>::Output, <MemoryTransport as Transport>::Error>

type Dial = DialFuture

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]

fn map<F, O>(self, map: F) -> Map<Self, F> where
    F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone
[src]

fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where
    F: FnOnce(Self::Error) -> TNewErr + Clone
[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
    U: InboundUpgrade<Self::Output, Output = O, Error = E> + OutboundUpgrade<Self::Output, Output = O, Error = E>,
    Self::Output: AsyncRead,
    Self::Output: AsyncWrite
[src]

fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where
    C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
    F: IntoFuture<Item = O>, 
[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 TcpConfig[src]

type Output = TcpTransStream

type Error = Error

type Listener = TcpListener

type ListenerUpgrade = FutureResult<<TcpConfig as Transport>::Output, <TcpConfig as Transport>::Error>

type Dial = TcpDialFut

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]

fn map<F, O>(self, map: F) -> Map<Self, F> where
    F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone
[src]

fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where
    F: FnOnce(Self::Error) -> TNewErr + Clone
[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
    U: InboundUpgrade<Self::Output, Output = O, Error = E> + OutboundUpgrade<Self::Output, Output = O, Error = E>,
    Self::Output: AsyncRead,
    Self::Output: AsyncWrite
[src]

fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where
    C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
    F: IntoFuture<Item = O>, 
[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]

type Output = UnixStream

type Error = Error

type Listener = ListenerStream<Incoming>

type ListenerUpgrade = FutureResult<<UdsConfig as Transport>::Output, Error>

type Dial = ConnectFuture

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]

fn map<F, O>(self, map: F) -> Map<Self, F> where
    F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone
[src]

fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where
    F: FnOnce(Self::Error) -> TNewErr + Clone
[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
    U: InboundUpgrade<Self::Output, Output = O, Error = E> + OutboundUpgrade<Self::Output, Output = O, Error = E>,
    Self::Output: AsyncRead,
    Self::Output: AsyncWrite
[src]

fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where
    C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
    F: IntoFuture<Item = O>, 
[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]

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 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]

fn map<F, O>(self, map: F) -> Map<Self, F> where
    F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone
[src]

fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where
    F: FnOnce(Self::Error) -> TNewErr + Clone
[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
    U: InboundUpgrade<Self::Output, Output = O, Error = E> + OutboundUpgrade<Self::Output, Output = O, Error = E>,
    Self::Output: AsyncRead,
    Self::Output: AsyncWrite
[src]

fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where
    C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
    F: IntoFuture<Item = O>, 
[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]

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 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]

fn map<F, O>(self, map: F) -> Map<Self, F> where
    F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone
[src]

fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where
    F: FnOnce(Self::Error) -> TNewErr + Clone
[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
    U: InboundUpgrade<Self::Output, Output = O, Error = E> + OutboundUpgrade<Self::Output, Output = O, Error = E>,
    Self::Output: AsyncRead,
    Self::Output: AsyncWrite
[src]

fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where
    C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
    F: IntoFuture<Item = O>, 
[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]

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 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]

fn map<F, O>(self, map: F) -> Map<Self, F> where
    F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone
[src]

fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where
    F: FnOnce(Self::Error) -> TNewErr + Clone
[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
    U: InboundUpgrade<Self::Output, Output = O, Error = E> + OutboundUpgrade<Self::Output, Output = O, Error = E>,
    Self::Output: AsyncRead,
    Self::Output: AsyncWrite
[src]

fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where
    C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
    F: IntoFuture<Item = O>, 
[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]

type Output = O

type Error = E

type Listener = Box<dyn Stream<Item = ListenerEvent<Box<dyn Future<Error = E, Item = O> + 'static + Send>>, Error = E> + 'static + Send>

type ListenerUpgrade = Box<dyn Future<Error = E, Item = O> + 'static + Send>

type Dial = Box<dyn Future<Error = E, Item = O> + 'static + Send>

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]

fn map<F, O>(self, map: F) -> Map<Self, F> where
    F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone
[src]

fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where
    F: FnOnce(Self::Error) -> TNewErr + Clone
[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
    U: InboundUpgrade<Self::Output, Output = O, Error = E> + OutboundUpgrade<Self::Output, Output = O, Error = E>,
    Self::Output: AsyncRead,
    Self::Output: AsyncWrite
[src]

fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where
    C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
    F: IntoFuture<Item = O>, 
[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]

type Output = <T as Transport>::Output

type Error = DnsErr<<T as Transport>::Error>

type Listener = MapErr<Map<<T as Transport>::Listener, fn(ListenerEvent<<T as Transport>::ListenerUpgrade>) -> ListenerEvent<<DnsConfig<T> as Transport>::ListenerUpgrade>>, 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<Error = Error, Item = Vec<IpAddr>> + 'static + Send>, <T as Transport>::Error>, FutureResult<Protocol<'static>, <DnsConfig<T> as Transport>::Error>>>>>>>

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]

fn map<F, O>(self, map: F) -> Map<Self, F> where
    F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone
[src]

fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where
    F: FnOnce(Self::Error) -> TNewErr + Clone
[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
    U: InboundUpgrade<Self::Output, Output = O, Error = E> + OutboundUpgrade<Self::Output, Output = O, Error = E>,
    Self::Output: AsyncRead,
    Self::Output: AsyncWrite
[src]

fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where
    C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
    F: IntoFuture<Item = O>, 
[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]

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 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]

fn map<F, O>(self, map: F) -> Map<Self, F> where
    F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone
[src]

fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where
    F: FnOnce(Self::Error) -> TNewErr + Clone
[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
    U: InboundUpgrade<Self::Output, Output = O, Error = E> + OutboundUpgrade<Self::Output, Output = O, Error = E>,
    Self::Output: AsyncRead,
    Self::Output: AsyncWrite
[src]

fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where
    C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
    F: IntoFuture<Item = O>, 
[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]

type Output = Box<dyn Stream + 'static + Send>

type Error = WsError<<T as Transport>::Error>

type Listener = Box<dyn Stream<Item = ListenerEvent<<WsConfig<T> as Transport>::ListenerUpgrade>, Error = <WsConfig<T> as Transport>::Error> + 'static + Send>

type ListenerUpgrade = Box<dyn Future<Error = <WsConfig<T> as Transport>::Error, Item = <WsConfig<T> as Transport>::Output> + 'static + Send>

type Dial = Box<dyn Future<Error = <WsConfig<T> as Transport>::Error, Item = <WsConfig<T> as Transport>::Output> + 'static + Send>

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]

fn map<F, O>(self, map: F) -> Map<Self, F> where
    F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone
[src]

fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where
    F: FnOnce(Self::Error) -> TNewErr + Clone
[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
    U: InboundUpgrade<Self::Output, Output = O, Error = E> + OutboundUpgrade<Self::Output, Output = O, Error = E>,
    Self::Output: AsyncRead,
    Self::Output: AsyncWrite
[src]

fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where
    C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
    F: IntoFuture<Item = O>, 
[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]

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 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]

fn map<F, O>(self, map: F) -> Map<Self, F> where
    F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone
[src]

fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where
    F: FnOnce(Self::Error) -> TNewErr + Clone
[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
    U: InboundUpgrade<Self::Output, Output = O, Error = E> + OutboundUpgrade<Self::Output, Output = O, Error = E>,
    Self::Output: AsyncRead,
    Self::Output: AsyncWrite
[src]

fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where
    C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
    F: IntoFuture<Item = O>, 
[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]

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 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]

fn map<F, O>(self, map: F) -> Map<Self, F> where
    F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone
[src]

fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where
    F: FnOnce(Self::Error) -> TNewErr + Clone
[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
    U: InboundUpgrade<Self::Output, Output = O, Error = E> + OutboundUpgrade<Self::Output, Output = O, Error = E>,
    Self::Output: AsyncRead,
    Self::Output: AsyncWrite
[src]

fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where
    C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
    F: IntoFuture<Item = O>, 
[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]

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 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]

fn map<F, O>(self, map: F) -> Map<Self, F> where
    F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone
[src]

fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where
    F: FnOnce(Self::Error) -> TNewErr + Clone
[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
    U: InboundUpgrade<Self::Output, Output = O, Error = E> + OutboundUpgrade<Self::Output, Output = O, Error = E>,
    Self::Output: AsyncRead,
    Self::Output: AsyncWrite
[src]

fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where
    C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
    F: IntoFuture<Item = O>, 
[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<TInner> Transport for BandwidthLogging<TInner> where
    TInner: Transport
[src]

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 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]

fn map<F, O>(self, map: F) -> Map<Self, F> where
    F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone
[src]

fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where
    F: FnOnce(Self::Error) -> TNewErr + Clone
[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
    U: InboundUpgrade<Self::Output, Output = O, Error = E> + OutboundUpgrade<Self::Output, Output = O, Error = E>,
    Self::Output: AsyncRead,
    Self::Output: AsyncWrite
[src]

fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where
    C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
    F: IntoFuture<Item = O>, 
[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<TOut> Transport for DummyTransport<TOut>[src]

type Output = TOut

type Error = Error

type Listener = Empty<ListenerEvent<<DummyTransport<TOut> as Transport>::ListenerUpgrade>, Error>

type ListenerUpgrade = Empty<<DummyTransport<TOut> as Transport>::Output, Error>

type Dial = Empty<<DummyTransport<TOut> as Transport>::Output, Error>

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]

fn map<F, O>(self, map: F) -> Map<Self, F> where
    F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone
[src]

fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where
    F: FnOnce(Self::Error) -> TNewErr + Clone
[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
    U: InboundUpgrade<Self::Output, Output = O, Error = E> + OutboundUpgrade<Self::Output, Output = O, Error = E>,
    Self::Output: AsyncRead,
    Self::Output: AsyncWrite
[src]

fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where
    C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
    F: IntoFuture<Item = O>, 
[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]

type Output = (PeerId, TMuxer)

type Error = TransportUpgradeError<<TTrans as Transport>::Error, Error>

type Listener = Empty<ListenerEvent<<IdentifyTransport<TTrans> as Transport>::ListenerUpgrade>, <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 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]

fn map<F, O>(self, map: F) -> Map<Self, F> where
    F: FnOnce(Self::Output, ConnectedPoint) -> O + Clone
[src]

fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where
    F: FnOnce(Self::Error) -> TNewErr + Clone
[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
    U: InboundUpgrade<Self::Output, Output = O, Error = E> + OutboundUpgrade<Self::Output, Output = O, Error = E>,
    Self::Output: AsyncRead,
    Self::Output: AsyncWrite
[src]

fn and_then<C, F, O>(self, upgrade: C) -> AndThen<Self, C> where
    C: FnOnce(Self::Output, ConnectedPoint) -> F + Clone,
    F: IntoFuture<Item = O>, 
[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]

Loading content...