Skip to main content

encode

Function encode 

Source
pub fn encode<E: Encoder, S: Source, W: Write, R: OperationPolicy>(
    encoder: E,
    source: S,
    writer: W,
    resolver: R,
    options: Options,
    pulse: Option<&dyn Pulse>,
) -> Result<Completed, At<Failure>>
Expand description

Encode a retained fixed-interpretation source through a prepared schedule.

Default policy chooses finish-first. No row-level refusal falls back to whole-image allocation. Policy runs once before reading source rows or publishing the header. The encoder, source, storage and writer stay retained across that decision. Unknown total wait retention is reported honestly.

Finish-first admits compressed chunks as they appear and drops source, row buffer and encoder before destination writes. Source I/O and explicit staging can still wait while native state is alive. Live mode pauses source reads during synchronous writes; this alone proves no native memory bound. Cancellation is checked around native calls and each writer operation; it cannot interrupt a blocking OS write. No retries or implicit finish on drop. None adds no per-call control. Controls retained by the encoder or source and all configured policy and resource requirements still apply.