Skip to main content

Module row_encode

Module row_encode 

Source
Expand description

Owned row-source encoding with policy before final-destination effects.

Finish-first is the default offer. It stages compressed bytes under the supplied storage budget, releases the source and encoder, then writes. Live output is offered only when begin reports streaming; it does not imply a memory bound. No native workspace or source allocation bound is inferred. Failures consume the operation, retain the selected decision and report confirmed destination appends. Partial output is never retried.

use zencodec::{encode::Encoder, operation::PolicySet, storage::StorageBudget};
use zencodec_io::row_encode::{self, Options, Raster};
use zenpixels::PixelSlice;
fn save<E: Encoder, W: std::io::Write>(
    encoder: E, pixels: PixelSlice<'_>, writer: W,
) -> Result<row_encode::Completed, Box<dyn core::error::Error>> {
    Ok(row_encode::encode(
        encoder, Raster::new(pixels), writer, PolicySet::new(),
        Options::new(StorageBudget::new(64 * 1024 * 1024, 4096), 64 * 1024 * 1024),
        None,
    )?)
}

Structs§

Completed
Successful destination completion and bounded decision history.
Description
Fixed sample declaration for this operation. Color conversion is not implicit.
ExactDepthContradiction
Actual samples contradict the declared grid. The complete strip is refused. Earlier live bytes remain irrevocable; no finish or alternate route is tried.
Failure
Terminal error. Default formatting omits backend payloads and source data.
Options
Managed payload storage and output limits. Neither bounds native allocations or queue bookkeeping.
Raster
Borrow a complete raster through the same row-source interface. An attached exact-depth claim is preserved and verified before each push. Unsupported claimed layouts refuse before startup; this is stricter than using an otherwise identical unclaimed view.

Enums§

Refusal
Driver contract refusal.
Stage
Operation boundary that failed.

Traits§

Source
A fixed-interpretation source, retained across policy and read on demand.

Functions§

encode
Encode a retained fixed-interpretation source through a prepared schedule.
encode_dyn_job
Run an already configured registry job through the planned row driver.
encode_dyn_job_to_destination
Run a retained erased job against a forward or seek-back destination.
encode_job
Encode a configured job to a writer, admitting its plan before native startup.
encode_job_to_destination
Execute a retained job’s declared row route against actual destination access.
encode_to_destination
Encode to an actual forward or seek-back destination. Layout admission occurs before policy, source reads and output publication. Patches are fully checked before final tail writes. I/O failure can leave partial overwrites; their confirmed byte count is distinct from appended extent. No automatic spooling converts a forward destination into a seekable one.