Struct netsim::iface::EtherIfaceBuilder
[−]
[src]
pub struct EtherIfaceBuilder { /* fields omitted */ }This object can be used to set the configuration options for a EtherIface before creating the
EtherIface
using build.
Methods
impl EtherIfaceBuilder[src]
pub fn new() -> EtherIfaceBuilder[src]
Start building a new EtherIface with the default configuration options.
pub fn name<S: Into<String>>(self, name: S) -> Self[src]
Set the interface name.
pub fn address(self, address: Ipv4Addr) -> Self[src]
Set the interface address.
pub fn netmask(self, netmask: Ipv4Addr) -> Self[src]
Set the interface netmask.
pub fn route(self, route: RouteV4) -> Self[src]
Add a route to the set of routes that will be created and directed through this interface.
pub fn build_unbound(self) -> Result<UnboundEtherIface, IfaceBuildError>[src]
Consume this EtherIfaceBuilder and build a UnboundEtherIface. This creates the TAP device but does not
bind it to a tokio event loop. This is useful if the event loop lives in a different thread
to where you need to create the device. You can send a UnboundEtherIface to another thread then
bind it to create your EtherIface.
pub fn build(self, handle: &Handle) -> Result<EtherIface, IfaceBuildError>[src]
Consume this EtherIfaceBuilder and build the TAP interface. The returned EtherIface object can be
used to read/write ethernet frames from this interface. handle is a handle to a tokio
event loop which will be used for reading/writing.
Trait Implementations
impl Debug for EtherIfaceBuilder[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more
impl Default for EtherIfaceBuilder[src]
fn default() -> EtherIfaceBuilder[src]
Returns the "default value" for a type. Read more