Trait Builder

Source
pub trait Builder<T> {
    // Required method
    fn try_build(self) -> Result<T, BuilderError>;
}
Expand description

Generic trait which all builder componenet must implement in order to be part of Configuration

Required Methods§

Source

fn try_build(self) -> Result<T, BuilderError>

Validate all the fields from the builder object and apply it to the final object

§Example
use firepilot::builder::Builder;
use firepilot::builder::network_interface::NetworkInterfaceBuilder;

NetworkInterfaceBuilder::new()
    .with_iface_id("eth0".to_string())
    .with_host_dev_name("tap0".to_string())
    .try_build()
    .unwrap();

Implementors§