pub struct DeviceState {
pub kind: String,
pub id: String,
pub mmio_slot: u32,
pub blob: Vec<u8>,
}Expand description
One device’s saved state — config + virtqueue cursors.
Devices serialise their own state into bitcode-friendly shapes; the snapshot
crate keeps the outer BTreeMap<DeviceKey, DeviceState> so the order is stable
across save/restore (per virtio-MMIO slot). The inner blob is opaque.
Fields§
§kind: StringDevice-class name ("virtio-block", "virtio-net", …).
id: StringIdentifier the API surface uses (e.g. drive_id, iface_id).
mmio_slot: u32virtio-MMIO slot index this device occupied.
blob: Vec<u8>Opaque per-device state — bitcode bytes the device emits.
Trait Implementations§
Source§impl Clone for DeviceState
impl Clone for DeviceState
Source§fn clone(&self) -> DeviceState
fn clone(&self) -> DeviceState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DeviceState
impl Debug for DeviceState
Source§impl<'de> Deserialize<'de> for DeviceState
impl<'de> Deserialize<'de> for DeviceState
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 DeviceState
impl PartialEq for DeviceState
Source§fn eq(&self, other: &DeviceState) -> bool
fn eq(&self, other: &DeviceState) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for DeviceState
impl Serialize for DeviceState
impl Eq for DeviceState
impl StructuralPartialEq for DeviceState
Auto Trait Implementations§
impl Freeze for DeviceState
impl RefUnwindSafe for DeviceState
impl Send for DeviceState
impl Sync for DeviceState
impl Unpin for DeviceState
impl UnsafeUnpin for DeviceState
impl UnwindSafe for DeviceState
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