interface_rs/interface/mapping.rs
1use std::path::PathBuf;
2
3/// Represents a `mapping` stanza in the `/etc/network/interfaces` file.
4///
5/// The `Mapping` struct holds the script and map entries associated with a
6/// mapping configuration.
7///
8/// # Examples
9///
10/// Creating a new `Mapping`:
11///
12/// ```rust
13/// use interface_rs::interface::Mapping;
14/// use std::path::PathBuf;
15///
16/// let mapping = Mapping {
17/// script: PathBuf::from("/usr/local/bin/map-scripts"),
18/// maps: vec!["eth0".to_string(), "eth1".to_string()],
19/// };
20/// ```
21#[derive(Debug, Clone, PartialEq)]
22pub struct Mapping {
23 /// The script to be used for mapping.
24 pub script: PathBuf,
25 /// A list of map entries.
26 pub maps: Vec<String>,
27}