Skip to content
API REFERENCEUsage guides →

cellpack::loader::RingHeader ​

struct

Module contract · All interfaces

At a glance ​

#[repr(C)]pub struct RingHeader {Show 17 fields
    pub magic: u64,
    pub version: u32,
    pub slots: u32,
    pub slot_cells: u32,
    pub world: u32,
    pub schemas: u32,
    pub reserved: u32,
    pub slot_stride: u64,
    pub slot_offset: u64,
    pub data_offset: u64,
    pub total_bytes: u64,
    pub positions: AtomicU64,
    pub abort: AtomicU32,
    pub producer: AtomicU32,
    pub generation: AtomicU64,
    pub offsets: [u64; 64],
    pub cell_bytes: [u32; 64],
}

The ring’s header, at the start of control memory: geometry, the current run, and per-schema region offsets and cell sizes.

Fields hold offsets and counts only, never pointers, so the same mapping is valid in every process that attaches it. Non-atomic fields are written once, before any participant joins.

Fields and variants ​

magic ​

magic: u64

MAGIC, so an unrelated mapping is rejected on attach.

version ​

version: u32

VERSION of this layout.

slots ​

slots: u32

Slots, and batch b’s slot number is b % slots.

slot_cells ​

slot_cells: u32

Positions per slot.

world ​

world: u32

Consumer ranks.

schemas ​

schemas: u32

Schemas, one region each per slot.

reserved ​

reserved: u32

EXTERNAL when control and data were initialized as separate regions; 0 for one contiguous mapping.

slot_stride ​

slot_stride: u64

Bytes from one slot’s start to the next.

slot_offset ​

slot_offset: u64

Offset of the first slot header from the start of control memory.

data_offset ​

data_offset: u64

Offset of the first slot’s data from the start of the mapping.

total_bytes ​

total_bytes: u64

Bytes of control and data together, as one mapping.

positions ​

positions: AtomicU64

Positions of the current run.

abort ​

abort: AtomicU32

Nonzero once any participant aborted the ring; never cleared.

producer ​

producer: AtomicU32

1 while a producer holds the ring, 0 otherwise.

generation ​

generation: AtomicU64

The current or last run’s generation.

offsets ​

offsets: [u64; 64]

Per schema: its region’s offset within a slot.

cell_bytes ​

cell_bytes: [u32; 64]

Per schema: bytes of one cell’s output.

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