Skip to main content

RingFrameSource

Trait RingFrameSource 

Source
pub trait RingFrameSource {
    // Required methods
    fn kind(&self) -> u8;
    fn head(&self) -> u64;
    fn capacity(&self) -> usize;
    fn read_at(&self, counter: u64) -> Option<Frame>;

    // Provided method
    fn read_state_at(&self, counter: u64) -> RingRead { ... }
}
Expand description

Read-only source that can be walked by RingCursor.

Implementors expose only the ring facts needed by the generic walker: the ring kind, current head, fixed capacity, and counter-addressed frame reads.

Required Methods§

Source

fn kind(&self) -> u8

The OrbitTyped::KIND carried by this ring.

Source

fn head(&self) -> u64

Monotonic visible head. Depending on topology, this counts counters reserved by writers or frames committed by writers.

Source

fn capacity(&self) -> usize

Fixed slot count for this ring.

Source

fn read_at(&self, counter: u64) -> Option<Frame>

Read the frame currently occupying counter % capacity.

Provided Methods§

Source

fn read_state_at(&self, counter: u64) -> RingRead

Classify the logical counter currently addressed by counter % capacity.

Sources that can distinguish an in-flight claim should override this method. The compatibility default preserves the previous read_at behavior for external implementations.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl RingFrameSource for Ring

Source§

impl RingFrameSource for ShmRing

Available on Unix only.