pub enum Method {
Static,
Dhcp,
Loopback,
Manual,
Other(String),
}Expand description
Represents the configuration method in the interfaces(5) file.
The Method enum constrains the method field to known values, while still
allowing custom methods through the Other variant.
§Variants
Static: Static IP configuration.Dhcp: DHCP client configuration.Loopback: Loopback interface configuration.Manual: Manual configuration (no automatic setup).Other: Any other method not explicitly supported.
§Examples
Parsing a Method from a string:
use interface_rs::interface::Method;
use std::str::FromStr;
let method = Method::from_str("dhcp").unwrap();
assert_eq!(method, Method::Dhcp);
// Unknown methods are captured as Other
let custom = Method::from_str("ppp").unwrap();
assert_eq!(custom, Method::Other("ppp".to_string()));Variants§
Static
Static IP configuration.
Dhcp
DHCP client configuration.
Loopback
Loopback interface configuration.
Manual
Manual configuration (no automatic setup).
Other(String)
Any other method not explicitly supported.
Trait Implementations§
impl StructuralPartialEq for Method
Auto Trait Implementations§
impl Freeze for Method
impl RefUnwindSafe for Method
impl Send for Method
impl Sync for Method
impl Unpin for Method
impl UnwindSafe for Method
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more