Struct ublox_cellular::sockets::udp::UdpSocket[][src]

pub struct UdpSocket<CLK: Clock, const L: usize> { /* fields omitted */ }
Expand description

A User Datagram Protocol socket.

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

Implementations

Create an UDP socket with the given buffers.

Return the socket handle.

Return the bound endpoint.

Set available data.

Get the number of bytes available to ingress.

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.

Check whether the socket is open.

Check whether the receive buffer is full.

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.

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

See also recv.

Peek at a packet received from a remote endpoint, and return the endpoint as well as a pointer to the payload without removing the packet from the receive buffer. This function otherwise behaves identically to recv.

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

Peek at a packet received from a remote endpoint, copy the payload into the given slice, and return the amount of octets copied as well as the endpoint without removing the packet from the receive buffer. This function otherwise behaves identically to recv_slice.

See also peek.

Trait Implementations

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.