Skip to content
API REFERENCEUsage guides →

cellpack::loader::Accesses ​

trait

Module contract · All interfaces

At a glance ​

pub trait Accesses: Send + Sync {
    // Required methods
    fn len(&self) -> u64;
    fn fill(&self, start: u64, out: &mut [CellId]) -> Result<()>;

    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn as_slice(&self) -> Option<&[CellId]> { ... }
}

A sequence of cells: a pure function from access index to CellId.

Implementations must be thread-safe and order-independent: fill is called concurrently for different ranges, possibly more than once for the same access, by workers and by the online compiler. The sequence is never required to be materialized; implementations that hold one say so with Accesses::as_slice, which lets a plan bind to the values without a copy.

Each index identifies one schema delivery. With S schemas, position k / S uses schema k % S. Implementations must return the same values for repeated and out-of-order range calls.

Member index ​

4 of 4 members

  • lenAccesses in the sequence. With S schemas this must be a multiple of S : access k is schema k % S of position k / S .
  • fillWrites the cells of accesses start..start + out.len() . Called concurrently, in any order, possibly more than once per access; the result must depend on the access only.
  • is_emptyWhether the sequence has no accesses.
  • as_sliceThe whole sequence, when it is held in memory; a fixed plan is verified against the sequence’s values, which Loader::prepare materializes when this is None .

Methods and associated constants ​

len ​

fn len(&self) -> u64

Accesses in the sequence. With S schemas this must be a multiple of S: access k is schema k % S of position k / S.

fill ​

fn fill(&self, start: u64, out: &mut [CellId]) -> Result<()>

Writes the cells of accesses start..start + out.len(). Called concurrently, in any order, possibly more than once per access; the result must depend on the access only.

is_empty ​

fn is_empty(&self) -> bool

Whether the sequence has no accesses.

as_slice ​

fn as_slice(&self) -> Option<&[CellId]>

The whole sequence, when it is held in memory; a fixed plan is verified against the sequence’s values, which Loader::prepare materializes when this is None.

Contract reference ​

See the module reference for semantic input/output rules, units, allocation, mutation, failure behavior, and lifetime requirements. Declarations and documented members are synchronized from the crate source.

Definition