pub struct P2pLinkConn { /* private fields */ }Expand description
A LinkConn implementation wrapping a high-level QUIC connection.
Implementations§
Source§impl P2pLinkConn
impl P2pLinkConn
Sourcepub fn new(
inner: HighLevelConnection,
peer_id: PeerId,
remote_addr: SocketAddr,
) -> Self
pub fn new( inner: HighLevelConnection, peer_id: PeerId, remote_addr: SocketAddr, ) -> Self
Create a new connection wrapper.
Sourcepub fn inner(&self) -> &HighLevelConnection
pub fn inner(&self) -> &HighLevelConnection
Get the underlying connection.
Trait Implementations§
Source§impl LinkConn for P2pLinkConn
impl LinkConn for P2pLinkConn
Source§fn remote_addr(&self) -> SocketAddr
fn remote_addr(&self) -> SocketAddr
Get the remote peer’s address.
Source§fn open_uni(&self) -> BoxFuture<'_, LinkResult<Box<dyn LinkSendStream>>>
fn open_uni(&self) -> BoxFuture<'_, LinkResult<Box<dyn LinkSendStream>>>
Open a unidirectional stream (send only).
Source§fn open_bi(
&self,
) -> BoxFuture<'_, LinkResult<(Box<dyn LinkSendStream>, Box<dyn LinkRecvStream>)>>
fn open_bi( &self, ) -> BoxFuture<'_, LinkResult<(Box<dyn LinkSendStream>, Box<dyn LinkRecvStream>)>>
Open a bidirectional stream.
Source§fn send_datagram(&self, data: Bytes) -> LinkResult<()>
fn send_datagram(&self, data: Bytes) -> LinkResult<()>
Send an unreliable datagram to the peer.
Source§fn recv_datagrams(&self) -> BoxStream<'_, Bytes>
fn recv_datagrams(&self) -> BoxStream<'_, Bytes>
Receive datagrams from the peer.
Source§fn stats(&self) -> ConnectionStats
fn stats(&self) -> ConnectionStats
Get connection statistics.
Auto Trait Implementations§
impl Freeze for P2pLinkConn
impl RefUnwindSafe for P2pLinkConn
impl Send for P2pLinkConn
impl Sync for P2pLinkConn
impl Unpin for P2pLinkConn
impl UnwindSafe for P2pLinkConn
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