[−][src]Struct libp2p_core::transport::dummy::DummyTransport
Implementation of Transport
that doesn't support any multiaddr.
Useful for testing purposes, or as a fallback implementation when no protocol is available.
Methods
impl<TOut> DummyTransport<TOut>
[src]
Trait Implementations
impl<TOut> Transport for DummyTransport<TOut>
[src]
type Output = TOut
The result of a connection setup process, including protocol upgrades. Read more
type Error = Error
An error that occurred during connection setup.
type Listener = Empty<ListenerEvent<Self::ListenerUpgrade>, Error>
A stream of Output
s for inbound connections. Read more
type ListenerUpgrade = Empty<Self::Output, Error>
A pending Output
for an inbound connection, obtained from the Listener
stream. Read more
type Dial = Empty<Self::Output, Error>
A pending Output
for an outbound connection, obtained from dialing. Read more
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>>
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]
Self: Sized + Clone + Send + Sync + 'static,
Self::Dial: Send + 'static,
Self::Listener: Send + 'static,
Self::ListenerUpgrade: Send + 'static,
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]
Self: Sized,
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
Self: Sized,
F: FnOnce(Self::Error) -> TNewErr + Clone,
[src]
Self: Sized,
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> where
Self: Sized,
[src]
Self: Sized,
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]
Self: Sized,
Self::Output: AsyncRead + AsyncWrite,
U: InboundUpgrade<Self::Output, Output = O, Error = E>,
U: OutboundUpgrade<Self::Output, Output = O, Error = E>,
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]
Self: Sized,
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> where
Self: Sized,
[src]
Self: Sized,
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]
Self: Sized,
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]
Self: Sized,
Adds a timeout to the connection setup (including upgrades) for all inbound connection attempts. Read more
impl<TOut> Clone for DummyTransport<TOut>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<TOut> Default for DummyTransport<TOut>
[src]
impl<TOut> Debug for DummyTransport<TOut>
[src]
Auto Trait Implementations
impl<TOut> Unpin for DummyTransport<TOut> where
TOut: Unpin,
TOut: Unpin,
impl<TOut> Sync for DummyTransport<TOut> where
TOut: Sync,
TOut: Sync,
impl<TOut> Send for DummyTransport<TOut> where
TOut: Send,
TOut: Send,
impl<TOut> RefUnwindSafe for DummyTransport<TOut> where
TOut: RefUnwindSafe,
TOut: RefUnwindSafe,
impl<TOut> UnwindSafe for DummyTransport<TOut> where
TOut: UnwindSafe,
TOut: UnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> 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, U> TryInto<U> 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> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Clear for T where
T: InitializableFromZeroed + ?Sized,
T: InitializableFromZeroed + ?Sized,
fn clear(&mut self)
impl<T> InitializableFromZeroed for T where
T: Default,
T: Default,