#[repr(C, align(4))]pub struct SlotHeader {
pub sequence_number: u32,
pub sample_size: u32,
pub reader_mask: ReaderMask,
pub _reserved: u32,
}Expand description
Slot header — set by the writer in commit_slot and interpreted by
the reader in read_flat.
The layout is repr(C, packed(4)) so the wire format is byte-stable
across all platforms.
Fields§
§sequence_number: u32Writer-local sequence number.
sample_size: u32Sample size in bytes (= T::WIRE_SIZE for FlatStruct<T>).
reader_mask: ReaderMaskBitmap: which readers have read. 0 = new, all 1-bits = free.
_reserved: u32Padding for cache-line alignment + future extensions.
Implementations§
Source§impl SlotHeader
impl SlotHeader
Sourcepub const fn all_read(&self, active_readers_mask: ReaderMask) -> bool
pub const fn all_read(&self, active_readers_mask: ReaderMask) -> bool
true when all bits in active_readers are set ⇒ the slot
is free (all readers have read).
Sourcepub fn mark_read(&mut self, reader_index: u8)
pub fn mark_read(&mut self, reader_index: u8)
Sets bit reader_index in reader_mask (the reader has read).
Sourcepub fn to_bytes_le(&self) -> [u8; 16]
pub fn to_bytes_le(&self) -> [u8; 16]
Wire encoding: 16 bytes little-endian.
Sourcepub fn from_bytes_le(bytes: &[u8]) -> Option<Self>
pub fn from_bytes_le(bytes: &[u8]) -> Option<Self>
Trait Implementations§
Source§impl Clone for SlotHeader
impl Clone for SlotHeader
Source§fn clone(&self) -> SlotHeader
fn clone(&self) -> SlotHeader
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SlotHeader
Source§impl Debug for SlotHeader
impl Debug for SlotHeader
impl Eq for SlotHeader
Source§impl PartialEq for SlotHeader
impl PartialEq for SlotHeader
Source§fn eq(&self, other: &SlotHeader) -> bool
fn eq(&self, other: &SlotHeader) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SlotHeader
Auto Trait Implementations§
impl Freeze for SlotHeader
impl RefUnwindSafe for SlotHeader
impl Send for SlotHeader
impl Sync for SlotHeader
impl Unpin for SlotHeader
impl UnsafeUnpin for SlotHeader
impl UnwindSafe for SlotHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more