#[non_exhaustive]pub struct SlotLocation {
pub slot: u32,
pub sequence: u64,
pub address: usize,
pub layout_address: usize,
pub mapping_base: usize,
pub mapping_len: usize,
}Expand description
Where a zero-copy payload sits in its ring (§6.2).
Everything needed to prove the bytes were never copied, which is what blueprint §21’s M1 row asks a probe to demonstrate rather than assert:
SlotLocation::is_inside_mapping— the payload address lies within the mapped segment, so it is not a heap buffer.SlotLocation::is_at_layout_offset— and it lies exactly where the segment’s layout puts that slot, computed from the mapping base rather than from the pointer being checked.SlotLocation::slotandSlotLocation::sequence— which slot of the ring, and which message. Over a long run the slots must cycle: a copying path would hand out a fresh address every time.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.slot: u32The ring slot the message occupies.
sequence: u64The message’s sequence number within the ring.
address: usizeThe address the payload bytes actually start at.
layout_address: usizeThe address the segment’s layout puts this slot’s payload at.
mapping_base: usizeThe first byte of the mapping.
mapping_len: usizeHow many bytes are mapped.
Implementations§
Source§impl SlotLocation
impl SlotLocation
Sourcepub const fn is_at_layout_offset(&self) -> bool
pub const fn is_at_layout_offset(&self) -> bool
Whether the payload starts where the layout says this slot’s payload starts.
Sourcepub const fn is_inside_mapping(&self) -> bool
pub const fn is_inside_mapping(&self) -> bool
Whether the payload address is inside the mapping.
Sourcepub const fn offset_in_mapping(&self) -> usize
pub const fn offset_in_mapping(&self) -> usize
The payload’s offset from the start of the mapping.
The portable form of “the same place”: two processes map the same ring
at whatever addresses their mmap chose, so the addresses differ
between them and the offsets do not.