Struct libp2p_tcp::Transport
source · pub struct Transport<T>where
T: Provider + Send,{ /* private fields */ }
Expand description
An abstract libp2p_core::Transport
implementation.
You shouldn’t need to use this type directly. Use one of the following instead:
Implementations§
Trait Implementations§
source§impl<T> Transport for Transport<T>
impl<T> Transport for Transport<T>
source§fn poll(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<TransportEvent<Self::ListenerUpgrade, Self::Error>>
fn poll( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<TransportEvent<Self::ListenerUpgrade, Self::Error>>
Poll all listeners.
§type Output = <T as Provider>::Stream
type Output = <T as Provider>::Stream
The result of a connection setup process, including protocol upgrades. Read more
§type Dial = Pin<Box<dyn Future<Output = Result<<Transport<T> as Transport>::Output, <Transport<T> as Transport>::Error>> + Send>>
type Dial = Pin<Box<dyn Future<Output = Result<<Transport<T> as Transport>::Output, <Transport<T> as Transport>::Error>> + Send>>
§type ListenerUpgrade = Ready<Result<<Transport<T> as Transport>::Output, <Transport<T> as Transport>::Error>>
type ListenerUpgrade = Ready<Result<<Transport<T> as Transport>::Output, <Transport<T> as Transport>::Error>>
source§fn listen_on(
&mut self,
id: ListenerId,
addr: Multiaddr,
) -> Result<(), TransportError<Self::Error>>
fn listen_on( &mut self, id: ListenerId, addr: Multiaddr, ) -> Result<(), TransportError<Self::Error>>
Listens on the given
Multiaddr
for inbound connections with a provided ListenerId
.source§fn remove_listener(&mut self, id: ListenerId) -> bool
fn remove_listener(&mut self, id: ListenerId) -> bool
Remove a listener. Read more
source§fn dial(
&mut self,
addr: Multiaddr,
opts: DialOpts,
) -> Result<Self::Dial, TransportError<Self::Error>>
fn dial( &mut self, addr: Multiaddr, opts: DialOpts, ) -> Result<Self::Dial, TransportError<Self::Error>>
source§fn map<F, O>(self, f: F) -> Map<Self, F>
fn map<F, O>(self, f: F) -> Map<Self, F>
Applies a function on the connections created by the transport.
source§fn map_err<F, E>(self, f: F) -> MapErr<Self, F>
fn map_err<F, E>(self, f: F) -> MapErr<Self, F>
Applies a function on the errors generated by the futures of the transport.
source§fn or_transport<U>(self, other: U) -> OrTransport<Self, U>
fn or_transport<U>(self, other: U) -> OrTransport<Self, U>
Adds a fallback transport that is used when encountering errors
while establishing inbound or outbound connections. Read more
Auto Trait Implementations§
impl<T> !Freeze for Transport<T>
impl<T> !RefUnwindSafe for Transport<T>
impl<T> Send for Transport<T>
impl<T> Sync for Transport<T>
impl<T> Unpin for Transport<T>
impl<T> !UnwindSafe for Transport<T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more