pub struct EthernetInterface<'b, 'c, 'e, DeviceT: for<'d> Device<'d>> { /* private fields */ }
Expand description

An Ethernet network interface.

The network interface logically owns a number of other data structures; to avoid a dependency on heap allocation, it instead owns a BorrowMut<[T]>, which can be a &mut [T], or Vec<T> if a heap is available.

Implementations§

Get the Ethernet address of the interface.

Set the Ethernet address of the interface.

Panics

This function panics if the address is not unicast.

Add an address to a list of subscribed multicast IP addresses.

Returns Ok(announce_sent) if the address was added successfully, where annouce_sent indicates whether an initial immediate announcement has been sent.

Remove an address from the subscribed multicast IP addresses.

Returns Ok(leave_sent) if the address was removed successfully, where leave_sent indicates whether an immediate leave packet has been sent.

Check whether the interface listens to given destination multicast IP address.

Get the IP addresses of the interface.

Update the IP addresses of the interface.

Panics

This function panics if any of the addresses are not unicast.

Check whether the interface has the given IP address assigned.

Get the first IPv4 address of the interface.

Transmit packets queued in the given sockets, and receive packets queued in the device.

This function returns a boolean value indicating whether any packets were processed or emitted, and thus, whether the readiness of any socket might have changed.

Errors

This method will routinely return errors in response to normal network activity as well as certain boundary conditions such as buffer exhaustion. These errors are provided as an aid for troubleshooting, and are meant to be logged and ignored.

As a special case, Err(Error::Unrecognized) is returned in response to packets containing any unsupported protocol, option, or form, which is a very common occurrence and on a production system it should not even be logged.

Return a soft deadline for calling poll the next time. The Instant returned is the time at which you should call poll next. It is harmless (but wastes energy) to call it before the Instant, and potentially harmful (impacting quality of service) to call it after the Instant

Return an advisory wait time for calling poll the next time. The Duration returned is the time left to wait before calling poll next. It is harmless (but wastes energy) to call it before the Duration has passed, and potentially harmful (impacting quality of service) to call it after the Duration has passed.

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.