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

A builder structure used for creating a Ethernet network interface.

Implementations§

Create a builder used for creating a network interface using the given device and address.

Examples
use smoltcp::iface::{EthernetInterfaceBuilder, NeighborCache};
use smoltcp::wire::{EthernetAddress, IpCidr, IpAddress};

let device = // ...
let hw_addr = // ...
let neighbor_cache = // ...
let ip_addrs = // ...
let iface = EthernetInterfaceBuilder::new(device)
        .ethernet_addr(hw_addr)
        .neighbor_cache(neighbor_cache)
        .ip_addrs(ip_addrs)
        .finalize();

Set the Ethernet address the interface will use. See also ethernet_addr.

Panics

This function panics if the address is not unicast.

Set the IP addresses the interface will use. See also ip_addrs.

Panics

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

Set the IP routes the interface will use. See also routes.

Provide storage for multicast groups.

Join multicast groups by calling join_multicast_group() on an Interface. Using join_multicast_group() will send initial membership reports.

A previously destroyed interface can be recreated by reusing the multicast group storage, i.e. providing a non-empty storage to ipv4_multicast_groups(). Note that this way initial membership reports are not sent.

Set the Neighbor Cache the interface will use.

Create a network interface using the previously provided configuration.

Panics

If a required option is not provided, this function will panic. Required options are:

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.