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]
fn new() -> EtherIfaceBuilder
[src]
Start building a new EtherIface
with the default configuration options.
fn name<S: Into<String>>(self, name: S) -> Self
[src]
Set the interface name.
fn address(self, address: Ipv4Addr) -> Self
[src]
Set the interface address.
fn netmask(self, netmask: Ipv4Addr) -> Self
[src]
Set the interface netmask.
fn route(self, route: RouteV4) -> Self
[src]
Add a route to the set of routes that will be created and directed through this interface.
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
.
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]
impl Default for EtherIfaceBuilder
[src]
fn default() -> EtherIfaceBuilder
[src]
Returns the "default value" for a type. Read more