Skip to main content

IcSnapshotArtifactWriter

Struct IcSnapshotArtifactWriter 

Source
pub struct IcSnapshotArtifactWriter<'journal, 'layout, 'metadata> { /* private fields */ }
Expand description

Exclusive ephemeral writer for one original journal artifact and exact IC metadata.

Each successful append retains decoded bytes in private descriptor-opened files. It reuses the model’s coverage owner and keeps only three hash states plus at most 1,024 chunk checksums. It borrows the original layout/journal for its whole lifetime. Appends consume the writer: any rejection or partial IO failure closes it and retains the partial tree, without a completion transition or permission to repeat reads. There is no partial-transfer reconstruction or automatic cleanup.

The integration must qualify the generic token’s association with the raw IC ID, authentic capture/metadata/data, original per-call spending, fresh read permission, complete backend transfer and stable noncooperating byte/command custody. This writer performs no provider calls and grants no upload/load/start, settlement or release.

Implementations§

Source§

impl<'layout> IcSnapshotArtifactWriter<'_, 'layout, '_>

Source

pub const fn coverage(&self) -> &IcSnapshotDataCoverage<'_>

Read the original declared coverage without changing it.

Source

pub fn path(&self) -> &Path

Read the fixed private staging path; stable external custody remains required.

Source

pub fn append( self, reply: &IcSnapshotDataReply<'_, '_>, ) -> Result<Self, IcSnapshotArtifactError>

Append one exact admitted reply without retaining its memory buffer.

Regions may interleave; each region must remain contiguous from zero. Chunk files use exact metadata hash names and exclusive creation. No fsync or journal transition occurs until explicit finish. Any error consumes this owner and retains all bytes.

§Errors

Rejects changed custody, coverage conflicts and filesystem failures.

Source

pub fn finish(self) -> Result<ArtifactChecksumRecord, IcSnapshotArtifactError>

Verify complete local bytes, retain their exact checksum and durably publish them.

Complete declared coverage is required. The fixed closed tree must match hashes computed from the actual admitted bytes, including original metadata and request. Existing model transitions derive Downloaded and ChecksumVerified together; their exact checksum is persisted atomically before the existing durable publisher runs. On interruption, reopen the journal and use its ordinary ChecksumVerified publication recovery without another read or transfer. Created partial trees cannot be resumed through this writer; preserve them for operator-owned disposition. Ordinary Durable replay reads only retained progress, without fresh byte verification.

The caller still owns authentic backend completeness, token/raw-ID association and stable custody. A returned checksum is local evidence, not a terminal/effect permit.

§Errors

Rejects incomplete coverage, extra/changed/unsafe bytes, replaced custody and failed persistence/publication. Failure can leave a verified or published tree; retain it. Closing directory-custody rejection can follow a retained Durable transition.

Trait Implementations§

Source§

impl Debug for IcSnapshotArtifactWriter<'_, '_, '_>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'journal, 'layout, 'metadata> !UnwindSafe for IcSnapshotArtifactWriter<'journal, 'layout, 'metadata>

§

impl<'journal, 'layout, 'metadata> Freeze for IcSnapshotArtifactWriter<'journal, 'layout, 'metadata>

§

impl<'journal, 'layout, 'metadata> RefUnwindSafe for IcSnapshotArtifactWriter<'journal, 'layout, 'metadata>

§

impl<'journal, 'layout, 'metadata> Send for IcSnapshotArtifactWriter<'journal, 'layout, 'metadata>

§

impl<'journal, 'layout, 'metadata> Sync for IcSnapshotArtifactWriter<'journal, 'layout, 'metadata>

§

impl<'journal, 'layout, 'metadata> Unpin for IcSnapshotArtifactWriter<'journal, 'layout, 'metadata>

§

impl<'journal, 'layout, 'metadata> UnsafeUnpin for IcSnapshotArtifactWriter<'journal, 'layout, 'metadata>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
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.