#[repr(C, align(64))]pub struct RingHeader {
magic: u32,
capacity: u32,
slot_size: u32,
flags: AtomicU32,
_pad1: [u8; 48],
head: AtomicU32,
notify_prod: AtomicU32,
_pad2: [u8; 56],
tail: AtomicU32,
notify_cons: AtomicU32,
_pad3: [u8; 56],
}Expand description
Shared ring header, placed at the start of the first physical page.
Cache-line layout (x86-64, 64-byte lines):
- Line 0: magic, capacity, slot_size, flags (read-mostly, rarely written)
- Line 1: head, notify_prod (written by consumer, read by producer)
- Line 2: tail, notify_cons (written by producer, read by consumer)
Fields§
§magic: u32Magic number for validating shared mappings.
capacity: u32Total number of slots (must be power of two).
slot_size: u32Usable bytes per slot.
flags: AtomicU32Flags field (bit 0 = initialised, bit 1 = producer_ready).
_pad1: [u8; 48]§head: AtomicU32Next slot to read. Written by consumer; read by producer.
notify_prod: AtomicU32Notification counter for the producer (written by consumer).
_pad2: [u8; 56]§tail: AtomicU32Next slot to write. Written by producer; read by consumer.
notify_cons: AtomicU32Notification counter for the consumer (written by producer).
_pad3: [u8; 56]Auto Trait Implementations§
impl !Freeze for RingHeader
impl RefUnwindSafe for RingHeader
impl Send for RingHeader
impl Sync for RingHeader
impl Unpin for RingHeader
impl UnsafeUnpin for RingHeader
impl UnwindSafe for RingHeader
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more