Struct libp2p_quic::GenTransport
source · pub struct GenTransport<P: Provider> { /* private fields */ }
Expand description
Implementation of the Transport
trait for QUIC.
By default only QUIC Version 1 (RFC 9000) is supported. In the Multiaddr
this maps to
libp2p_core::multiaddr::Protocol::QuicV1
.
The libp2p_core::multiaddr::Protocol::Quic
codepoint is interpreted as QUIC version
draft-29 and only supported if Config::support_draft_29
is set to true
.
Note that in that case servers support both version an all QUIC listening addresses.
Version draft-29 should only be used to connect to nodes from other libp2p implementations
that do not support QuicV1
yet. Support for it will be removed long-term.
See https://github.com/multiformats/multiaddr/issues/145.
Implementations§
source§impl<P: Provider> GenTransport<P>
impl<P: Provider> GenTransport<P>
sourcepub fn new(config: Config) -> Self
pub fn new(config: Config) -> Self
Create a new GenTransport
with the given Config
.
Trait Implementations§
source§impl<P: Provider> Transport for GenTransport<P>
impl<P: Provider> Transport for GenTransport<P>
§type Output = (PeerId, Connection)
type Output = (PeerId, Connection)
The result of a connection setup process, including protocol upgrades. Read more
§type ListenerUpgrade = Connecting
type ListenerUpgrade = Connecting
§type Dial = Pin<Box<dyn Future<Output = Result<<GenTransport<P> as Transport>::Output, <GenTransport<P> as Transport>::Error>> + Send>>
type Dial = Pin<Box<dyn Future<Output = Result<<GenTransport<P> as Transport>::Output, <GenTransport<P> as Transport>::Error>> + Send>>
source§fn listen_on(
&mut self,
listener_id: ListenerId,
addr: Multiaddr,
) -> Result<(), TransportError<Self::Error>>
fn listen_on( &mut self, listener_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,
dial_opts: DialOpts,
) -> Result<Self::Dial, TransportError<Self::Error>>
fn dial( &mut self, addr: Multiaddr, dial_opts: DialOpts, ) -> Result<Self::Dial, TransportError<Self::Error>>
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 for
TransportEvent
s. Read moresource§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<P> !Freeze for GenTransport<P>
impl<P> !RefUnwindSafe for GenTransport<P>
impl<P> Send for GenTransport<P>
impl<P> !Sync for GenTransport<P>
impl<P> Unpin for GenTransport<P>
impl<P> !UnwindSafe for GenTransport<P>
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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