pub struct NetworkLease {
pub vm: VmId,
pub ip: IpAddr,
pub prefix_len: u8,
pub gateway: IpAddr,
pub mac: MacAddr,
pub cleanup_token: String,
}Expand description
A reserved address and the host resources planned for one VM.
Serialized into the VM’s durable record so cleanup can be replayed after
a crash; cleanup_token is what the two-step cleanup protocol checks.
Deliberately plain — no #[non_exhaustive], because a runtime builds
one from a record it read back and needs every field. What that costs
is that the field names are an on-disk contract: a field added here
must carry #[serde(default)] so a record written before it still
loads, and nothing may key on the order they are declared in.
Fields§
§vm: VmIdThe VM this lease belongs to.
ip: IpAddrThe guest’s address.
prefix_len: u8The subnet prefix length.
gateway: IpAddrThe gateway the guest routes through.
mac: MacAddrThe guest’s MAC address.
cleanup_token: StringOpaque; presented to NetworkReconcile::finalize_cleanup to prove
the caller is finishing this generation of the VM’s cleanup.
Trait Implementations§
Source§impl Clone for NetworkLease
impl Clone for NetworkLease
Source§impl Debug for NetworkLease
impl Debug for NetworkLease
Source§impl<'de> Deserialize<'de> for NetworkLease
impl<'de> Deserialize<'de> for NetworkLease
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>,
impl Eq for NetworkLease
Source§impl PartialEq for NetworkLease
impl PartialEq for NetworkLease
Source§impl Serialize for NetworkLease
impl Serialize for NetworkLease
impl StructuralPartialEq for NetworkLease
Auto Trait Implementations§
impl Freeze for NetworkLease
impl RefUnwindSafe for NetworkLease
impl Send for NetworkLease
impl Sync for NetworkLease
impl Unpin for NetworkLease
impl UnsafeUnpin for NetworkLease
impl UnwindSafe for NetworkLease
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.