pub struct SmolUdpSocket(/* private fields */);Expand description
Async-io-backed UDP socket for use with QUIC transports.
Trait Implementations§
Source§impl AsFd for SmolUdpSocket
Available on Unix only.
impl AsFd for SmolUdpSocket
Available on Unix only.
Source§fn as_fd(&self) -> BorrowedFd<'_>
fn as_fd(&self) -> BorrowedFd<'_>
Borrows the file descriptor. Read more
Source§impl Debug for SmolUdpSocket
impl Debug for SmolUdpSocket
Source§impl UdpTransport for SmolUdpSocket
impl UdpTransport for SmolUdpSocket
Source§fn from_std(socket: UdpSocket) -> Result<Self>
fn from_std(socket: UdpSocket) -> Result<Self>
Wrap a bound, non-blocking std UDP socket into this async type.
Source§fn local_addr(&self) -> Result<SocketAddr>
fn local_addr(&self) -> Result<SocketAddr>
The local address this socket is bound to.
Source§fn poll_recv_io<R>(
&self,
cx: &mut Context<'_>,
recv: impl FnMut(&Self) -> Result<R>,
) -> Poll<Result<R>>
fn poll_recv_io<R>( &self, cx: &mut Context<'_>, recv: impl FnMut(&Self) -> Result<R>, ) -> Poll<Result<R>>
Poll for read readiness, then attempt a receive operation. Read more
Source§fn poll_writable(&self, cx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_writable(&self, cx: &mut Context<'_>) -> Poll<Result<()>>
Poll for write readiness without attempting any I/O. Read more
Source§fn try_send_io<R>(&self, send: impl FnOnce(&Self) -> Result<R>) -> Result<R>
fn try_send_io<R>(&self, send: impl FnOnce(&Self) -> Result<R>) -> Result<R>
Attempt a send operation, managing readiness state. Read more
Source§fn max_transmit_segments(&self) -> usize
fn max_transmit_segments(&self) -> usize
Maximum number of datagrams to send in a single syscall (GSO).
Source§fn max_receive_segments(&self) -> usize
fn max_receive_segments(&self) -> usize
Maximum number of datagrams to receive in a single syscall (GRO).
Source§fn may_fragment(&self) -> bool
fn may_fragment(&self) -> bool
Whether outbound datagrams may be fragmented by the network layer.
Auto Trait Implementations§
impl Freeze for SmolUdpSocket
impl RefUnwindSafe for SmolUdpSocket
impl Send for SmolUdpSocket
impl Sync for SmolUdpSocket
impl Unpin for SmolUdpSocket
impl UnsafeUnpin for SmolUdpSocket
impl UnwindSafe for SmolUdpSocket
Blanket Implementations§
Source§impl<T> AsSource for Twhere
T: AsFd,
impl<T> AsSource for Twhere
T: AsFd,
Source§fn source(&self) -> BorrowedFd<'_>
fn source(&self) -> BorrowedFd<'_>
Returns the borrowed file descriptor.
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