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

Function state_from_id

vm-migration/src/lib.rs:206–215  ·  view source on GitHub ↗
(s: Option<&'a Snapshot>, id: &str)

Source from the content-addressed store, hash-verified

204}
205
206pub fn state_from_id<'a, T>(s: Option<&'a Snapshot>, id: &str) -> Result<Option<T>, MigratableError>
207where
208 T: Deserialize<'a>,
209{
210 if let Some(s) = s.as_ref() {
211 s.snapshots.get(id).map(|s| s.to_state()).transpose()
212 } else {
213 Ok(None)
214 }
215}
216
217/// A snapshottable component can be snapshotted.
218pub trait Snapshottable: Pausable {

Callers 15

newMethod · 0.85
newMethod · 0.85
newMethod · 0.85
add_pci_devicesMethod · 0.85
add_legacy_devicesMethod · 0.85
add_serial_deviceMethod · 0.85

Calls 3

to_stateMethod · 0.80
mapMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected