pub struct SharedSocket { /* private fields */ }Expand description
Adapter that satisfies quinn::AsyncUdpSocket for a
virtual_socket::VirtualUdpSocket.
Construct via SharedSocket::new, then hand the resulting
Arc<SharedSocket> to
quinn::Endpoint::new_with_abstract_socket.
Implementations§
Sourcepub fn new(inner: Arc<VirtualUdpSocket>) -> Arc<Self>
pub fn new(inner: Arc<VirtualUdpSocket>) -> Arc<Self>
Wrap a virtual_socket::VirtualUdpSocket.
Sourcepub fn virtual_socket(&self) -> &Arc<VirtualUdpSocket>
pub fn virtual_socket(&self) -> &Arc<VirtualUdpSocket>
Borrow the underlying virtual socket — useful if the caller needs to reach the inbound-enqueue side from the same value.
Trait Implementations§
Source§fn try_send(&self, transmit: &Transmit<'_>) -> Result<()>
fn try_send(&self, transmit: &Transmit<'_>) -> Result<()>
Send UDP datagrams from
transmits, or return WouldBlock and clear the underlying
socket’s readiness, or return an I/O error Read moreSource§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 max_transmit_segments(&self) -> usize
fn max_transmit_segments(&self) -> usize
Maximum number of datagrams that a
Transmit may encodeSource§fn max_receive_segments(&self) -> usize
fn max_receive_segments(&self) -> usize
Maximum number of datagrams that might be described by a single
RecvMetaSource§fn may_fragment(&self) -> bool
fn may_fragment(&self) -> bool
Whether datagrams might get fragmented into multiple parts Read more
Auto Trait Implementations§
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