Struct network_bridge::BridgeBuilder
source · pub struct BridgeBuilder { /* private fields */ }
Expand description
Builder pattern for constructing networking bridges.
Example
Create a bridge named hello_world_br
and attach two interfaces: eth0
and eth1
.
let result = BridgeBuilder::new("hello_world_br")
.interface("eth0")
.interface("eth1")
.build();
Implementations§
source§impl BridgeBuilder
impl BridgeBuilder
sourcepub fn new(name: &str) -> BridgeBuilder
pub fn new(name: &str) -> BridgeBuilder
Start building a new bridge, setting its interface name.
sourcepub fn name(self, name: &str) -> BridgeBuilder
pub fn name(self, name: &str) -> BridgeBuilder
Override the name of the bridge.
sourcepub fn interface(self, name: &str) -> BridgeBuilder
pub fn interface(self, name: &str) -> BridgeBuilder
Attach an interface to the bridge.
Note that this will fail silently if the interface name supplied cannot be converted into the appropriate interface index.
sourcepub fn remove_interface(self, name: &str) -> BridgeBuilder
pub fn remove_interface(self, name: &str) -> BridgeBuilder
Remove an interface from the bridge.
Note that this will fail silently if the interface name supplied cannot be converted into the appropriate interface index.