pub struct DevNetwork {
pub name: String,
pub bridge_name: String,
pub subnet: String,
pub gateway: String,
pub created_at: String,
}Expand description
A named dev-mode network with its own bridge and subnet.
Stored as JSON files in {mvm_share_dir}/networks/<name>.json.
Fields§
§name: StringUser-facing network name (e.g. “default”, “isolated”).
bridge_name: StringLinux bridge device name (e.g. “br-mvm-default”).
subnet: StringSubnet CIDR (e.g. “172.16.0.0/24”).
gateway: StringGateway IP — first usable address (e.g. “172.16.0.1”).
created_at: StringRFC 3339 creation timestamp.
Implementations§
Source§impl DevNetwork
impl DevNetwork
Sourcepub fn default_network() -> Self
pub fn default_network() -> Self
The built-in default network, matching the legacy hardcoded bridge.
Sourcepub fn new(name: &str, slot: u8) -> Result<Self>
pub fn new(name: &str, slot: u8) -> Result<Self>
Create a new named network with an auto-assigned subnet.
slot is a 1-based index used to derive a unique 172.16.X.0/24 subnet.
Slot 0 is reserved for the default network.
Sourcepub fn gateway_cidr(&self) -> String
pub fn gateway_cidr(&self) -> String
CIDR notation for the gateway (e.g. “172.16.0.1/24”).
Trait Implementations§
Source§impl Clone for DevNetwork
impl Clone for DevNetwork
Source§fn clone(&self) -> DevNetwork
fn clone(&self) -> DevNetwork
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DevNetwork
impl Debug for DevNetwork
Source§impl<'de> Deserialize<'de> for DevNetwork
impl<'de> Deserialize<'de> for DevNetwork
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DevNetwork
impl PartialEq for DevNetwork
Source§impl Serialize for DevNetwork
impl Serialize for DevNetwork
impl Eq for DevNetwork
impl StructuralPartialEq for DevNetwork
Auto Trait Implementations§
impl Freeze for DevNetwork
impl RefUnwindSafe for DevNetwork
impl Send for DevNetwork
impl Sync for DevNetwork
impl Unpin for DevNetwork
impl UnsafeUnpin for DevNetwork
impl UnwindSafe for DevNetwork
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.