pub fn new(device: DeviceT) -> InterfaceBuilder<'b, 'c, DeviceT> {
        InterfaceBuilder {
            device:              device,
            ethernet_addr:       None,
            neighbor_cache:      None,
            ip_addrs:            ManagedSlice::Borrowed(&mut []),
            #[cfg(feature = "proto-ipv4")]
            ipv4_gateway:        None
        }
    }
/// Create a builder used for creating a network interface using the
/// given device and address.
///
/// # Examples
///
/// ```
/// # use std::collections::BTreeMap;
/// use smoltcp::iface::{EthernetInterfaceBuilder, NeighborCache};
/// # use smoltcp::phy::Loopback;
/// use smoltcp::wire::{EthernetAddress, IpCidr, IpAddress};
///
/// let device = // ...
/// # Loopback::new();
/// let hw_addr = // ...
/// # EthernetAddress::default();
/// let neighbor_cache = // ...
/// # NeighborCache::new(BTreeMap::new());
/// let ip_addrs = // ...
/// # [];
/// let iface = EthernetInterfaceBuilder::new(device)
///         .ethernet_addr(hw_addr)
///         .neighbor_cache(neighbor_cache)
///         .ip_addrs(ip_addrs)
///         .finalize();
/// ```
Create a builder used for creating a network interface using the
given device and address.
Create a builder used for creating a network interface using the given device and address .
pub fn new(device: DeviceT) -> InterfaceBuilder<'b, 'c, DeviceT> {
        InterfaceBuilder {
            device:              device,
            ethernet_addr:       None,
            neighbor_cache:      None,
            ip_addrs:            ManagedSlice::Borrowed(&mut []),
            #[cfg(feature = "proto-ipv4")]
            ipv4_gateway:        None
        }
    }
pub fn new ( device : DeviceT ) -> InterfaceBuilder < ' b , ' c , DeviceT > { InterfaceBuilder { device : device , ethernet_addr : None , neighbor_cache : None , ip_addrs : ManagedSlice :: Borrowed ( & mut [ ] ) , # [ cfg ( feature " " ) ] ipv4_gateway : None } }
Create a builder used for creating a network interface using the
given device and address.
Create a builder used for creating a network interface using the given device and address .
device
DeviceT
device
DeviceT
examples
None
use std::collections::btreemap;
use smoltcp::iface::{EthernetInterfaceBuilder, NeighborCache}.
use smoltcp :: iface :: { EthernetInterfaceBuilder NeighborCache } .
use smoltcp::phy::loopback;
use smoltcp::wire::{EthernetAddress, IpCidr, IpAddress}.

let device =
use smoltcp :: wire :: { EthernetAddress IpCidr IpAddress } . let device =
loopback::new();
let hw_addr =
let hw_addr =
ethernetaddress::default();
let neighbor_cache =
let neighbor_cache =
neighborcache::new(btreemap::new());
let ip_addrs =
let ip_addrs =
[];
let iface = EthernetInterfaceBuilder::new(device)
.ethernet_addr(hw_addr)
.neighbor_cache(neighbor_cache)
.ip_addrs(ip_addrs)
.finalize();
```
let iface = EthernetInterfaceBuilder :: new ( device ) . ethernet_addr ( hw_addr ) . neighbor_cache ( neighbor_cache ) . ip_addrs ( ip_addrs ) . finalize () ; ` ` `