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§
Provided Methods§
Sourcefn read_state_at(&self, counter: u64) -> RingRead
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§
impl RingFrameSource for Ring
impl RingFrameSource for ShmRing
Available on Unix only.