Struct smoltcp::socket::RawSocket

source ·
pub struct RawSocket<'a, 'b: 'a> { /* private fields */ }
Expand description

A raw IP socket.

A raw socket is bound to a specific IP protocol, and owns transmit and receive packet buffers.

Implementations§

Create a raw IP socket bound to the given IP version and datagram protocol, with the given buffers.

Return the socket handle.

Return the IP version the socket is bound to.

Return the IP protocol the socket is bound to.

Check whether the transmit buffer is full.

Check whether the receive buffer is not empty.

Enqueue a packet to send, and return a pointer to its payload.

This function returns Err(Error::Exhausted) if the transmit buffer is full, and Err(Error::Truncated) if there is not enough transmit buffer capacity to ever send this packet.

If the buffer is filled in a way that does not match the socket’s IP version or protocol, the packet will be silently dropped.

Note: The IP header is parsed and reserialized, and may not match the header actually transmitted bit for bit.

Enqueue a packet to send, and fill it from a slice.

See also send.

Dequeue a packet, and return a pointer to the payload.

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

Note: The IP header is parsed and reserialized, and may not match the header actually received bit for bit.

Dequeue a packet, and copy the payload into the given slice.

See also recv.

Trait Implementations§

Formats the value using the given formatter. Read more
Converts this type into the (usually inferred) input type.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.