Struct smoltcp::socket::UdpSocket [] [src]

pub struct UdpSocket<'a, 'b: 'a> { /* fields omitted */ }

An User Datagram Protocol socket.

An UDP socket is bound to a specific endpoint, and owns transmit and receive packet buffers.

Methods

impl<'a, 'b> UdpSocket<'a, 'b>
[src]

[src]

Create an UDP socket with the given buffers.

[src]

Return the debug identifier.

[src]

Set the debug identifier.

The debug identifier is a number printed in socket trace messages. It could as well be used by the user code.

[src]

Return the bound endpoint.

[src]

Bind the socket to the given endpoint.

This function returns Err(Error::Illegal) if the socket was open (see is_open), and Err(Error::Unaddressable) if the port in the given endpoint is zero.

[src]

Check whether the socket is open.

[src]

Check whether the transmit buffer is full.

[src]

Check whether the receive buffer is not empty.

[src]

Enqueue a packet to be sent to a given remote endpoint, and return a pointer to its payload.

This function returns Err(Error::Exhausted) if the transmit buffer is full, Err(Error::Truncated) if the requested size is larger than the packet buffer size, and Err(Error::Unaddressable) if local or remote port, or remote address, are unspecified.

[src]

Enqueue a packet to be sent to a given remote endpoint, and fill it from a slice.

See also send.

[src]

Dequeue a packet received from a remote endpoint, and return the endpoint as well as a pointer to the payload.

This function returns Err(Error::Exhausted) if the receive buffer is empty.

[src]

Dequeue a packet received from a remote endpoint, and return the endpoint as well as copy the payload into the given slice.

See also recv.

Trait Implementations

impl<'a, 'b: 'a> Debug for UdpSocket<'a, 'b>
[src]

[src]

Formats the value using the given formatter.