Skip to main content

RingHeader

Struct RingHeader 

Source
#[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: u32

Magic number for validating shared mappings.

§capacity: u32

Total number of slots (must be power of two).

§slot_size: u32

Usable bytes per slot.

§flags: AtomicU32

Flags field (bit 0 = initialised, bit 1 = producer_ready).

§_pad1: [u8; 48]§head: AtomicU32

Next slot to read. Written by consumer; read by producer.

§notify_prod: AtomicU32

Notification counter for the producer (written by consumer).

§_pad2: [u8; 56]§tail: AtomicU32

Next slot to write. Written by producer; read by consumer.

§notify_cons: AtomicU32

Notification counter for the consumer (written by producer).

§_pad3: [u8; 56]

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.