Skip to main content

Op

Enum Op 

Source
pub enum Op {
    EmitObject {
        object_id: u32,
    },
    Inline {
        bytes: Vec<u8>,
    },
    RepeatLast {
        count: u32,
    },
    DecodeChannel {
        channel_id: u32,
    },
    InterleaveChannels {
        kinds_channel: u32,
        lengths_channel: u32,
        first_payload_channel: u32,
        payload_channel_count: u8,
    },
    MarkOffset {
        slot: u8,
    },
    EmitOffset {
        slot: u8,
        width: u8,
    },
    PackSegments {
        data_object: u32,
        items: Vec<PackItem>,
    },
    PackedChannels {
        data_channel: u32,
        plan_channel: u32,
        declared_output_len: u64,
    },
    DeflateReplay {
        replay_codec: u8,
        source_kind: u8,
        source_id: u32,
        corrections_object: u32,
        declared_output_len: u32,
    },
}
Expand description

A single reconstruction instruction.

Variants§

§

EmitObject

Emit the exact bytes of the referenced object.

Fields

§object_id: u32

Index into the descriptor’s object table.

§

Inline

Emit literal bytes carried inline in the graph record.

Fields

§bytes: Vec<u8>

The literal bytes.

§

RepeatLast

Repeat the byte output of the immediately preceding instruction count additional times.

Fields

§count: u32

Number of extra copies.

§

DecodeChannel

Emit the decoded bytes of the referenced entropy channel.

Fields

§channel_id: u32

Index into the descriptor’s entropy channel table.

§

InterleaveChannels

Reconstruct bytes by interleaving a contiguous range of per-kind payload channels. A kind channel holds one kind byte per token; a lengths channel holds one little-endian u32 per token; payload channel first_payload_channel + k carries the token spans whose kind is k.

Fields

§kinds_channel: u32

Channel holding one kind byte per token.

§lengths_channel: u32

Channel holding four little-endian length bytes per token.

§first_payload_channel: u32

First channel of the contiguous per-kind payload channel range.

§payload_channel_count: u8

Number of payload channels; valid kinds are 0..payload_channel_count.

§

MarkOffset

Record the current output position (a u64) into the named slot. Emits no output bytes; the recorded value is available to later Op::EmitOffset instructions.

Fields

§slot: u8

Slot index; must be below crate::dra::program::MAX_OFFSET_SLOTS.

§

EmitOffset

Emit the decimal form of a previously marked output position, left zero-padded to exactly width bytes.

Fields

§slot: u8

Slot index marked by an earlier Op::MarkOffset.

§width: u8

Exact output width in bytes.

§

PackSegments

Reconstruct output from a compact item table over one data object, amortizing per-segment framing: literal runs copy contiguous data-object bytes, marks record output positions, and emits render marked positions as fixed-width decimals. The data object must be consumed exactly.

Fields

§data_object: u32

Index into the descriptor’s object table.

§items: Vec<PackItem>

Ordered items describing the reconstruction.

§

PackedChannels

Reconstruct output from a data entropy channel interpreted by a serialized item table carried in a plan entropy channel. This lets one layout plan travel through rANS-coded channels instead of a literal data object, so the plan and its data pay entropy-coding cost together. The plan channel holds exactly encode_items of the item table, and the data channel must be consumed exactly.

Fields

§data_channel: u32

Index into the descriptor’s entropy channel table for the data.

§plan_channel: u32

Index into the descriptor’s entropy channel table for the plan.

§declared_output_len: u64

Exact reconstructed output length; must equal the produced length.

§

DeflateReplay

Reconstruct the exact original raw DEFLATE bitstream from a plaintext source plus an opaque correction object, replaying the producer’s DEFLATE coding decisions. Emits raw DEFLATE (RFC 1951) bytes only; any zlib framing is composed by surrounding instructions. declared_output_len is the exact expected raw payload length, validated at evaluation.

The plaintext may come from either the object table (source_kind = DEFLATE_SOURCE_OBJECT) or an entropy channel (source_kind = DEFLATE_SOURCE_CHANNEL); the channel form lets several streams share one stored plaintext capsule. Reconstruction can panic internally on hostile correction data, so it is isolated and never panics the decoder (see crate::codec::deflate).

Fields

§replay_codec: u8

Replay-codec identity: which exact reconstruction semantics the corrections blob is bound to. Must be REPLAY_DEFLATE_PREFLATE_0_7_6. The correction state is an opaque, version-coupled preflate blob; this tag makes that explicit on the wire so the format can never silently treat the current preflate internal representation as a stable standard.

§source_kind: u8

Plaintext source kind (DEFLATE_SOURCE_OBJECT / DEFLATE_SOURCE_CHANNEL).

§source_id: u32

Index into the object or channel table selected by source_kind.

§corrections_object: u32

Index into the descriptor’s object table holding the corrections.

§declared_output_len: u32

Exact length (bytes) of the raw DEFLATE payload the op reproduces.

Implementations§

Source§

impl Op

Source

pub fn encode(&self, out: &mut Vec<u8>) -> Result<()>

Encode this instruction into out.

Source

pub fn decode(data: &[u8], pos: &mut usize, limits: Limits) -> Result<Op>

Decode one instruction from data[*pos..], advancing *pos.

Trait Implementations§

Source§

impl Clone for Op

Source§

fn clone(&self) -> Self

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 Op

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for Op

Source§

impl PartialEq for Op

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Op

Auto Trait Implementations§

§

impl Freeze for Op

§

impl RefUnwindSafe for Op

§

impl Send for Op

§

impl Sync for Op

§

impl Unpin for Op

§

impl UnsafeUnpin for Op

§

impl UnwindSafe for Op

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.