Skip to main content

CheckpointClosure

Struct CheckpointClosure 

Source
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

Source

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.

Source

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.

Source

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.

Source

pub fn root_id(&self) -> &ObjectId

Return the immutable root identity computed from canonical checkpoint.json bytes.

Source

pub fn root(&self) -> &Path

Root of this verified immutable closure.

Source

pub fn checkpoint(&self) -> &CheckpointManifest

Return the validated composite manifest.

Source

pub fn memory(&self) -> &MemoryManifest

Return the complete logical memory generation.

Source

pub fn disks(&self) -> &[DiskGenerationManifest]

Return the validated disk generations.

Source

pub fn read_object(&self, id: &ObjectId, max_len: u64) -> ImageResult<Vec<u8>>

Read and reverify one immutable object, bounded by max_len.

Source

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.

Source

pub fn disk_layer_path(&self, layer: &DiskLayerRef) -> PathBuf

Return the confined path of a validated disk layer.

Source

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.

Source

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

Source§

fn clone(&self) -> CheckpointClosure

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CheckpointClosure

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more