pub struct MasqueRelaySocket { /* private fields */ }Expand description
A virtual UDP socket that tunnels packets through a MASQUE relay via a persistent QUIC stream with length-prefixed framing.
Implementations§
Source§impl MasqueRelaySocket
impl MasqueRelaySocket
Sourcepub fn new(
send_stream: SendStream,
recv_stream: RecvStream,
relay_public_addr: SocketAddr,
) -> Arc<Self> ⓘ
pub fn new( send_stream: SendStream, recv_stream: RecvStream, relay_public_addr: SocketAddr, ) -> Arc<Self> ⓘ
Create a new stream-based relay socket.
Spawns two background tasks:
- Read from
recv_stream, decode frames, queue forpoll_recv - Read from
send_txchannel, write length-prefixed frames tosend_stream
Trait Implementations§
Source§impl AsyncUdpSocket for MasqueRelaySocket
impl AsyncUdpSocket for MasqueRelaySocket
Source§fn poll_recv(
&self,
cx: &mut Context<'_>,
bufs: &mut [IoSliceMut<'_>],
meta: &mut [RecvMeta],
) -> Poll<Result<usize>>
fn poll_recv( &self, cx: &mut Context<'_>, bufs: &mut [IoSliceMut<'_>], meta: &mut [RecvMeta], ) -> Poll<Result<usize>>
Receive UDP datagrams, or register to be woken if receiving may succeed in the future
Source§fn local_addr(&self) -> Result<SocketAddr>
fn local_addr(&self) -> Result<SocketAddr>
Look up the local IP address and port used by this socket
Source§fn may_fragment(&self) -> bool
fn may_fragment(&self) -> bool
Whether datagrams might get fragmented into multiple parts Read more
Source§fn max_receive_segments(&self) -> usize
fn max_receive_segments(&self) -> usize
Maximum number of datagrams that might be described by a single
RecvMetaAuto Trait Implementations§
impl !Freeze for MasqueRelaySocket
impl RefUnwindSafe for MasqueRelaySocket
impl Send for MasqueRelaySocket
impl Sync for MasqueRelaySocket
impl Unpin for MasqueRelaySocket
impl UnsafeUnpin for MasqueRelaySocket
impl UnwindSafe for MasqueRelaySocket
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