Struct smoltcp::iface::EthernetInterfaceBuilder [−][src]
A builder structure used for creating a Ethernet network interface.
Implementations
impl<'a, DeviceT> InterfaceBuilder<'a, DeviceT> where
DeviceT: for<'d> Device<'d>,
[src]
DeviceT: for<'d> Device<'d>,
pub fn new(device: DeviceT) -> Self
[src]
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();
pub fn ethernet_addr(self, addr: EthernetAddress) -> Self
[src]
Set the Ethernet address the interface will use. See also ethernet_addr.
Panics
This function panics if the address is not unicast.
pub fn ip_addrs<T>(self, ip_addrs: T) -> Self where
T: Into<ManagedSlice<'a, IpCidr>>,
[src]
T: Into<ManagedSlice<'a, IpCidr>>,
Set the IP addresses the interface will use. See also ip_addrs.
Panics
This function panics if any of the addresses are not unicast.
pub fn any_ip(self, enabled: bool) -> Self
[src]
Enable or disable the AnyIP capability, allowing packets to be received locally on IPv4 addresses other than the interface’s configured ip_addrs. When AnyIP is enabled and a route prefix in routes specifies one of the interface’s ip_addrs as its gateway, the interface will accept packets addressed to that prefix.
IPv6
This option is not available or required for IPv6 as packets sent to the interface are not filtered by IPv6 address.
pub fn routes<T>(self, routes: T) -> InterfaceBuilder<'a, DeviceT> where
T: Into<Routes<'a>>,
[src]
T: Into<Routes<'a>>,
Set the IP routes the interface will use. See also routes.
pub fn ipv4_multicast_groups<T>(self, ipv4_multicast_groups: T) -> Self where
T: Into<ManagedMap<'a, Ipv4Address, ()>>,
[src]
T: Into<ManagedMap<'a, Ipv4Address, ()>>,
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.
pub fn neighbor_cache(self, neighbor_cache: NeighborCache<'a>) -> Self
[src]
Set the Neighbor Cache the interface will use.
pub fn finalize(self) -> Interface<'a, DeviceT>
[src]
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
impl<'a, DeviceT> RefUnwindSafe for InterfaceBuilder<'a, DeviceT> where
DeviceT: RefUnwindSafe,
DeviceT: RefUnwindSafe,
impl<'a, DeviceT> Send for InterfaceBuilder<'a, DeviceT> where
DeviceT: Send,
DeviceT: Send,
impl<'a, DeviceT> Sync for InterfaceBuilder<'a, DeviceT> where
DeviceT: Sync,
DeviceT: Sync,
impl<'a, DeviceT> Unpin for InterfaceBuilder<'a, DeviceT> where
DeviceT: Unpin,
DeviceT: Unpin,
impl<'a, DeviceT> !UnwindSafe for InterfaceBuilder<'a, DeviceT>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,