[−][src]Struct libp2p::core::transport::choice::OrTransport
Struct returned by or_transport()
.
Methods
impl<A, B> OrTransport<A, B>
[src]
pub fn new(a: A, b: B) -> OrTransport<A, B>
[src]
Trait Implementations
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>
The result of a connection setup process, including protocol upgrades. Read more
type Error = EitherError<<A as Transport>::Error, <B as Transport>::Error>
An error that occurred during connection setup.
type Listener = EitherListenStream<<A as Transport>::Listener, <B as Transport>::Listener>
A stream of Output
s for inbound connections. Read more
type ListenerUpgrade = EitherFuture<<A as Transport>::ListenerUpgrade, <B as Transport>::ListenerUpgrade>
A pending Output
for an inbound connection, obtained from the Listener
stream. Read more
type Dial = EitherFuture<<A as Transport>::Dial, <B as Transport>::Dial>
A pending Output
for an outbound connection, obtained from dialing. Read more
fn listen_on(
self,
addr: Multiaddr
) -> Result<(<OrTransport<A, B> as Transport>::Listener, Multiaddr), TransportError<<OrTransport<A, B> as Transport>::Error>>
[src]
self,
addr: Multiaddr
) -> Result<(<OrTransport<A, B> as Transport>::Listener, Multiaddr), TransportError<<OrTransport<A, B> as Transport>::Error>>
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>>
fn nat_traversal(
&self,
server: &Multiaddr,
observed: &Multiaddr
) -> Option<Multiaddr>
[src]
&self,
server: &Multiaddr,
observed: &Multiaddr
) -> Option<Multiaddr>
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 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,
[src]
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,
[src]
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>
[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
U: InboundUpgrade<Self::Output, Output = O, Error = E> + OutboundUpgrade<Self::Output, Output = O, Error = E>,
Self::Output: AsyncRead,
Self::Output: AsyncWrite,
[src]
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
]. Read more
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]
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. Read more
fn with_timeout(self, timeout: Duration) -> TransportTimeout<Self>
[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>
[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>
[src]
Adds a timeout to the connection setup (including upgrades) for all inbound connection attempts. Read more
impl<A, B> Clone for OrTransport<A, B> where
A: Clone,
B: Clone,
[src]
A: Clone,
B: Clone,
fn clone(&self) -> OrTransport<A, B>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<A, B> Debug for OrTransport<A, B> where
A: Debug,
B: Debug,
[src]
A: Debug,
B: Debug,
impl<A, B> Copy for OrTransport<A, B> where
A: Copy,
B: Copy,
[src]
A: Copy,
B: Copy,
Auto Trait Implementations
impl<A, B> Send for OrTransport<A, B> where
A: Send,
B: Send,
A: Send,
B: Send,
impl<A, B> Sync for OrTransport<A, B> where
A: Sync,
B: Sync,
A: Sync,
B: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Same for T
type Output = T
Should always be Self
impl<T> Erased for T
impl<T> Erased for T
impl<T> Typeable for T where
T: Any,
T: Any,