[][src]Struct libp2p_core::transport::upgrade::Upgrade

pub struct Upgrade<T, U> { /* fields omitted */ }

Methods

impl<T, U> Upgrade<T, U>[src]

pub fn new(inner: T, upgrade: U) -> Self[src]

Trait Implementations

impl<D, U, O, TUpgrErr> Transport for Upgrade<D, U> where
    D: Transport,
    D::Output: AsyncRead + AsyncWrite,
    D::Error: 'static,
    U: InboundUpgrade<D::Output, Output = O, Error = TUpgrErr>,
    U: OutboundUpgrade<D::Output, Output = O, Error = TUpgrErr> + Clone,
    TUpgrErr: Error + Send + Sync + 'static, 
[src]

type Output = O

The result of a connection setup process, including protocol upgrades. Read more

type Error = TransportUpgradeError<D::Error, TUpgrErr>

An error that occurred during connection setup.

type Listener = ListenerStream<D::Listener, U>

A stream of Outputs for inbound connections. Read more

type ListenerUpgrade = ListenerUpgradeFuture<D::ListenerUpgrade, U>

A pending Output for an inbound connection, obtained from the Listener stream. Read more

type Dial = DialUpgradeFuture<D::Dial, U>

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

fn boxed(self) -> Boxed<Self::Output, Self::Error> where
    Self: Sized + Clone + Send + Sync + 'static,
    Self::Dial: Send + 'static,
    Self::Listener: Send + 'static,
    Self::ListenerUpgrade: Send + 'static, 
[src]

Turns this Transport into an abstract boxed transport.

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

Applies a function on the connections created by the transport.

fn map_err<F, TNewErr>(self, map_err: F) -> MapErr<Self, F> where
    Self: Sized,
    F: FnOnce(Self::Error) -> TNewErr + Clone
[src]

Applies a function on the errors generated by the futures of the transport.

fn or_transport<T>(self, other: T) -> OrTransport<Self, T> where
    Self: Sized
[src]

Builds a new transport that falls back to another transport when encountering errors on dialing or listening for connections. Read more

fn with_upgrade<U, O, E>(self, upgrade: U) -> Upgrade<Self, U> where
    Self: Sized,
    Self::Output: AsyncRead + AsyncWrite,
    U: InboundUpgrade<Self::Output, Output = O, Error = E>,
    U: OutboundUpgrade<Self::Output, Output = O, Error = E>, 
[src]

Wraps this transport inside an Upgrade. Read more

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

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

fn with_timeout(self, timeout: Duration) -> TransportTimeout<Self> where
    Self: Sized
[src]

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

fn with_outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> where
    Self: Sized
[src]

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

fn with_inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self> where
    Self: Sized
[src]

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

impl<T: Copy, U: Copy> Copy for Upgrade<T, U>[src]

impl<T: Clone, U: Clone> Clone for Upgrade<T, U>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Debug, U: Debug> Debug for Upgrade<T, U>[src]

Auto Trait Implementations

impl<T, U> Send for Upgrade<T, U> where
    T: Send,
    U: Send

impl<T, U> Sync for Upgrade<T, U> where
    T: Sync,
    U: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Same for T

type Output = T

Should always be Self

impl<T> Erased for T