Struct disarray_network::GenTcpTransport
pub struct GenTcpTransport<T>where
T: Provider + Send,{ /* private fields */ }
Implementations
impl<T> GenTcpTransport<T>where
T: Provider + Send,
impl<T> GenTcpTransport<T>where
T: Provider + Send,
pub fn new(config: GenTcpConfig) -> GenTcpTransport<T>
Trait Implementations
impl<T> Default for GenTcpTransport<T>where
T: Provider + Send,
impl<T> Default for GenTcpTransport<T>where
T: Provider + Send,
fn default() -> GenTcpTransport<T>
fn default() -> GenTcpTransport<T>
impl<T> Transport for GenTcpTransport<T>where
T: 'static + Provider + Send,
<T as Provider>::Listener: Unpin,
<T as Provider>::Stream: Unpin,
impl<T> Transport for GenTcpTransport<T>where
T: 'static + Provider + Send,
<T as Provider>::Listener: Unpin,
<T as Provider>::Stream: Unpin,
fn address_translation(
&self,
listen: &Multiaddr,
observed: &Multiaddr
) -> Option<Multiaddr>
fn address_translation(
&self,
listen: &Multiaddr,
observed: &Multiaddr
) -> Option<Multiaddr>
When port reuse is disabled and hence ephemeral local ports are
used for outgoing connections, the returned address is the
observed
address with the port replaced by the port of the
listen
address.
If port reuse is enabled, Some(observed)
is returned, as there
is a chance that the observed
address and port are reachable
for other peers if there is a NAT in the way that does endpoint-
independent filtering. Furthermore, even if that is not the case
and TCP hole punching techniques must be used for NAT traversal,
the observed
address is still the one that a remote should connect
to for the purpose of the hole punching procedure, as it represents
the mapped IP and port of the NAT device in front of the local
node.
None
is returned if one of the given addresses is not a TCP/IP
address.
fn poll(
self: Pin<&mut GenTcpTransport<T>>,
cx: &mut Context<'_>
) -> Poll<TransportEvent<<GenTcpTransport<T> as Transport>::ListenerUpgrade, <GenTcpTransport<T> as Transport>::Error>>
fn poll(
self: Pin<&mut GenTcpTransport<T>>,
cx: &mut Context<'_>
) -> Poll<TransportEvent<<GenTcpTransport<T> as Transport>::ListenerUpgrade, <GenTcpTransport<T> as Transport>::Error>>
Poll all listeners.
type Output = <T as Provider>::Stream
type Output = <T as Provider>::Stream
type Dial = Pin<Box<dyn Future<Output = Result<<GenTcpTransport<T> as Transport>::Output, <GenTcpTransport<T> as Transport>::Error>> + Send + 'static, Global>>
type Dial = Pin<Box<dyn Future<Output = Result<<GenTcpTransport<T> as Transport>::Output, <GenTcpTransport<T> as Transport>::Error>> + Send + 'static, Global>>
type ListenerUpgrade = Ready<Result<<GenTcpTransport<T> as Transport>::Output, <GenTcpTransport<T> as Transport>::Error>>
type ListenerUpgrade = Ready<Result<<GenTcpTransport<T> as Transport>::Output, <GenTcpTransport<T> as Transport>::Error>>
fn listen_on(
&mut self,
addr: Multiaddr
) -> Result<ListenerId, TransportError<<GenTcpTransport<T> as Transport>::Error>>
fn listen_on(
&mut self,
addr: Multiaddr
) -> Result<ListenerId, TransportError<<GenTcpTransport<T> as Transport>::Error>>
Multiaddr
] for inbound connections.fn remove_listener(&mut self, id: ListenerId) -> bool
fn remove_listener(&mut self, id: ListenerId) -> bool
fn dial(
&mut self,
addr: Multiaddr
) -> Result<<GenTcpTransport<T> as Transport>::Dial, TransportError<<GenTcpTransport<T> as Transport>::Error>>
fn dial(
&mut self,
addr: Multiaddr
) -> Result<<GenTcpTransport<T> as Transport>::Dial, TransportError<<GenTcpTransport<T> as Transport>::Error>>
Multiaddr
], returning a future for a pending outbound connection. Read morefn dial_as_listener(
&mut self,
addr: Multiaddr
) -> Result<<GenTcpTransport<T> as Transport>::Dial, TransportError<<GenTcpTransport<T> as Transport>::Error>>
fn dial_as_listener(
&mut self,
addr: Multiaddr
) -> Result<<GenTcpTransport<T> as Transport>::Dial, TransportError<<GenTcpTransport<T> as Transport>::Error>>
Transport::dial
] but has the local node act as a listener on the outgoing connection. Read morefn map<F, O>(self, f: F) -> Map<Self, F>where
Self: Sized,
F: FnOnce(Self::Output, ConnectedPoint) -> O,
fn map<F, O>(self, f: F) -> Map<Self, F>where
Self: Sized,
F: FnOnce(Self::Output, ConnectedPoint) -> O,
fn map_err<F, E>(self, f: F) -> MapErr<Self, F>where
Self: Sized,
F: FnOnce(Self::Error) -> E,
fn map_err<F, E>(self, f: F) -> MapErr<Self, F>where
Self: Sized,
F: FnOnce(Self::Error) -> E,
fn or_transport<U>(self, other: U) -> OrTransport<Self, U>where
Self: Sized,
U: Transport,
<U as Transport>::Error: 'static,
fn or_transport<U>(self, other: U) -> OrTransport<Self, U>where
Self: Sized,
U: Transport,
<U as Transport>::Error: 'static,
fn and_then<C, F, O>(self, f: C) -> AndThen<Self, C>where
Self: Sized,
C: FnOnce(Self::Output, ConnectedPoint) -> F,
F: TryFuture<Ok = O>,
<F as TryFuture>::Error: 'static + Error,
fn and_then<C, F, O>(self, f: C) -> AndThen<Self, C>where
Self: Sized,
C: FnOnce(Self::Output, ConnectedPoint) -> F,
F: TryFuture<Ok = O>,
<F as TryFuture>::Error: 'static + Error,
fn upgrade(self, version: Version) -> Builder<Self>where
Self: Sized,
Self::Error: 'static,
fn upgrade(self, version: Version) -> Builder<Self>where
Self: Sized,
Self::Error: 'static,
upgrade::Builder
. Read moreAuto Trait Implementations
impl<T> !RefUnwindSafe for GenTcpTransport<T>
impl<T> Send for GenTcpTransport<T>
impl<T> !Sync for GenTcpTransport<T>
impl<T> Unpin for GenTcpTransport<T>
impl<T> !UnwindSafe for GenTcpTransport<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<TTransport> TransportExt for TTransportwhere
TTransport: Transport,
impl<TTransport> TransportExt for TTransportwhere
TTransport: Transport,
sourcefn with_bandwidth_logging(self) -> (BandwidthLogging<Self>, Arc<BandwidthSinks>)where
Self: Sized,
fn with_bandwidth_logging(self) -> (BandwidthLogging<Self>, Arc<BandwidthSinks>)where
Self: Sized,
Transport
that logs all trafic that passes through the sockets
created by it. Read more