pub struct VirtualUdpSocket { /* private fields */ }Implementations§
Source§impl VirtualUdpSocket
impl VirtualUdpSocket
pub fn local_port(&self) -> u16
pub fn send_to_node( &self, node: NodeId, port: u16, payload: &[u8], ecn: Option<u8>, ) -> Result<(), VirtualNetError>
pub fn send_to( &self, dest: SocketAddrV4, payload: &[u8], ecn: Option<u8>, ) -> Result<(), VirtualNetError>
pub fn try_recv_from(&self) -> Option<VirtualSocketPkt>
pub async fn recv_from(&self) -> Option<VirtualSocketPkt>
Trait Implementations§
Source§impl AsyncUdpSocket for VirtualUdpSocket
impl AsyncUdpSocket for VirtualUdpSocket
Source§fn poll_send(
&self,
_state: &UdpState,
_cx: &mut Context<'_>,
transmits: &[Transmit],
) -> Poll<Result<usize, Error>>
fn poll_send( &self, _state: &UdpState, _cx: &mut Context<'_>, transmits: &[Transmit], ) -> Poll<Result<usize, Error>>
Send UDP datagrams from
transmits, or register to be woken if sending may succeed in the
futureSource§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§impl Debug for VirtualUdpSocket
impl Debug for VirtualUdpSocket
Auto Trait Implementations§
impl Freeze for VirtualUdpSocket
impl !RefUnwindSafe for VirtualUdpSocket
impl Send for VirtualUdpSocket
impl Sync for VirtualUdpSocket
impl Unpin for VirtualUdpSocket
impl !UnwindSafe for VirtualUdpSocket
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