Skip to main content

ComposeSpec

Struct ComposeSpec 

Source
pub struct ComposeSpec<'a> {
    pub key: &'a str,
    pub local_path: &'a Path,
    pub parts: Vec<PartSource>,
    pub base_key: Option<&'a str>,
    pub base_etag: Option<String>,
    pub condition: PutCondition,
    pub stamps: GenerationStamps,
    pub crc64: Option<u64>,
    pub progress: Option<Arc<AtomicU64>>,
}
Expand description

The flusher’s order for one generation publish.

Fields§

§key: &'a str§local_path: &'a Path

Local source of Local parts. Clean ranges are byte-identical local and remote by definition, so crc64 is computable from this file alone.

§parts: Vec<PartSource>

Contiguous from offset 0, sizes within the backend’s part granularity (the A11 part-size grid upstream owns that).

§base_key: Option<&'a str>

Where the base generation LIVES, when it is not key — the A7 re-key flush publishes a renamed file under its new key while clean ranges still copy from the old one. None = same as key.

§base_etag: Option<String>

Base generation’s ETag — required iff any part is BaseCopy.

§condition: PutCondition§stamps: GenerationStamps§crc64: Option<u64>

Full-object CRC-64/NVME of the composed content, from local truth. Backends hand it to the store for SERVER-SIDE validation at publish: a mismatch fails the publish, never warns.

None asks the store to accumulate it from the Local parts as it reads them for upload. Parts go up in order, one at a time, so a streaming CRC over them in that loop IS the CRC of the object — the same local truth, without a second pass over the file (a 40 GiB pack’s pre-pass was ~70 s on forge’s push path, 2026-09-05). A BaseCopy part is never read locally, so a spec with one and None is refused before any part moves.

§progress: Option<Arc<AtomicU64>>

Bytes landed so far, for a caller that has to prove LIVENESS while a long compose runs: forge’s lease renewer renews a push only while this advances, so a wedged upload lets the token go quiet and a challenger take over — which is the one takeover a wedged holder can get. Advanced by len after every part, Local and BaseCopy alike. None = nobody is watching.

Implementations§

Source§

impl ComposeSpec<'_>

Source

pub fn note_progress(&self, bytes: u64)

Record bytes more of the object as landed.

Trait Implementations§

Source§

impl<'a> Clone for ComposeSpec<'a>

Source§

fn clone(&self) -> ComposeSpec<'a>

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<'a> Debug for ComposeSpec<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for ComposeSpec<'a>

§

impl<'a> RefUnwindSafe for ComposeSpec<'a>

§

impl<'a> Send for ComposeSpec<'a>

§

impl<'a> Sync for ComposeSpec<'a>

§

impl<'a> Unpin for ComposeSpec<'a>

§

impl<'a> UnsafeUnpin for ComposeSpec<'a>

§

impl<'a> UnwindSafe for ComposeSpec<'a>

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, 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> 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.