MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / to_state

Method to_state

vm-migration/src/lib.rs:126–132  ·  view source on GitHub ↗

Generate the state data from the snapshot data

(&'a self)

Source from the content-addressed store, hash-verified

124impl SnapshotData {
125 /// Generate the state data from the snapshot data
126 pub fn to_state<'a, T>(&'a self) -> Result<T, MigratableError>
127 where
128 T: Deserialize<'a>,
129 {
130 serde_json::from_str(&self.state)
131 .map_err(|e| MigratableError::Restore(anyhow!("Error deserialising: {e}")))
132 }
133
134 /// Create from state that can be serialized
135 pub fn new_from_state<T>(state: &T) -> Result<Self, MigratableError>

Callers 10

newMethod · 0.80
newMethod · 0.80
newMethod · 0.80
newMethod · 0.80
get_vm_snapshotFunction · 0.80
create_vcpuMethod · 0.80
new_from_snapshotMethod · 0.80
state_from_idFunction · 0.80
newMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected