#[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 — wird vom Writer beim commit_slot gesetzt und vom
Reader beim read_flat interpretiert.
Layout ist repr(C, packed(4)) damit das Wire-Format byte-stable
auf allen Plattformen ist.
Fields§
§sequence_number: u32Writer-lokale Sequenz-Nummer.
sample_size: u32Sample-Size in Bytes (= T::WIRE_SIZE fuer FlatStruct<T>).
reader_mask: ReaderMaskBitmap: welche Reader haben gelesen. 0 = neu, alle 1-Bits = frei.
_reserved: u32Padding fuer Cache-Line-Alignment + zukuenftige Erweiterungen.
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 wenn alle Bits in active_readers gesetzt sind ⇒ Slot
ist frei (alle Reader haben gelesen).
Sourcepub fn mark_read(&mut self, reader_index: u8)
pub fn mark_read(&mut self, reader_index: u8)
Setzt Bit reader_index im reader_mask (Reader hat gelesen).
Sourcepub fn to_bytes_le(&self) -> [u8; 16]
pub fn to_bytes_le(&self) -> [u8; 16]
Wire-Encoding: 16 byte 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 moreSource§impl Debug for SlotHeader
impl Debug 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 Copy for SlotHeader
impl Eq for SlotHeader
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