pub struct CheckpointClosure { /* private fields */ }Expand description
A validated, self-contained checkpoint closure rooted at a published directory.
Opening verifies the canonical root and every transitively referenced manifest, object slice, and disk layer. Later restore reads still verify object identities so replacing bytes between admission and consumption fails closed.
Implementations§
Source§impl CheckpointClosure
impl CheckpointClosure
Sourcepub fn inspect_manifest(
root: &Path,
expected_root: Option<&ObjectId>,
) -> ImageResult<CheckpointManifest>
pub fn inspect_manifest( root: &Path, expected_root: Option<&ObjectId>, ) -> ImageResult<CheckpointManifest>
Inspect the bounded, identity-verified root for construction planning, not payload admission. The child closure must still be fully opened before its contents are consumed.
Sourcepub fn open(
root: impl Into<PathBuf>,
expected_root: Option<&ObjectId>,
) -> ImageResult<Self>
pub fn open( root: impl Into<PathBuf>, expected_root: Option<&ObjectId>, ) -> ImageResult<Self>
Open and validate a checkpoint closure for restore on this host architecture.
Sourcepub fn open_portable(
root: impl Into<PathBuf>,
expected_root: Option<&ObjectId>,
) -> ImageResult<Self>
pub fn open_portable( root: impl Into<PathBuf>, expected_root: Option<&ObjectId>, ) -> ImageResult<Self>
Open and validate a checkpoint closure without requiring host architecture compatibility.
Inspection, verification, and archive transport use this path. Construction must use
open so an incompatible checkpoint cannot reach restore.
Sourcepub fn root_id(&self) -> &ObjectId
pub fn root_id(&self) -> &ObjectId
Return the immutable root identity computed from canonical checkpoint.json bytes.
Sourcepub fn checkpoint(&self) -> &CheckpointManifest
pub fn checkpoint(&self) -> &CheckpointManifest
Return the validated composite manifest.
Sourcepub fn memory(&self) -> &MemoryManifest
pub fn memory(&self) -> &MemoryManifest
Return the complete logical memory generation.
Sourcepub fn disks(&self) -> &[DiskGenerationManifest]
pub fn disks(&self) -> &[DiskGenerationManifest]
Return the validated disk generations.
Sourcepub fn read_object(&self, id: &ObjectId, max_len: u64) -> ImageResult<Vec<u8>>
pub fn read_object(&self, id: &ObjectId, max_len: u64) -> ImageResult<Vec<u8>>
Read and reverify one immutable object, bounded by max_len.
Sourcepub fn read_object_into(
&self,
id: &ObjectId,
max_len: u64,
bytes: &mut Vec<u8>,
) -> ImageResult<CheckpointObjectReadTiming>
pub fn read_object_into( &self, id: &ObjectId, max_len: u64, bytes: &mut Vec<u8>, ) -> ImageResult<CheckpointObjectReadTiming>
Load and verify one object into reusable storage, without changing its identity contract. The buffer must not be consumed when this method fails.
Sourcepub fn disk_layer_path(&self, layer: &DiskLayerRef) -> PathBuf
pub fn disk_layer_path(&self, layer: &DiskLayerRef) -> PathBuf
Return the confined path of a validated disk layer.
Sourcepub fn reused_disk_integrity(&self, path: &Path) -> ImageResult<Option<String>>
pub fn reused_disk_integrity(&self, path: &Path) -> ImageResult<Option<String>>
Reuse a disk root only while the candidate is the exact unchanged admitted file. Copies, rewritten qcow headers, replaced names, and uncached layers return no reusable root. A later explicit integrity capture may compute one. Retained file handles are bounded.
Sourcepub fn verify_memory_objects(&self) -> ImageResult<()>
pub fn verify_memory_objects(&self) -> ImageResult<()>
Stream and verify every immutable memory payload referenced by the logical generation.
Restore normally fuses this check with copying bytes into guest memory. Explicit artifact verification uses this method when no restore read is available to amortize the work.
Trait Implementations§
Source§impl Clone for CheckpointClosure
impl Clone for CheckpointClosure
Source§fn clone(&self) -> CheckpointClosure
fn clone(&self) -> CheckpointClosure
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more