pub struct ReaderSlot<'a> { /* private fields */ }Expand description
Acquire-only capability bound to a validated read-only mapping.
Implementations§
Source§impl<'a> ReaderSlot<'a>
impl<'a> ReaderSlot<'a>
Sourcepub unsafe fn bind(
header: &'a SlotMetadata,
binding: ReaderSlotBinding,
) -> Result<Self, SlotError>
pub unsafe fn bind( header: &'a SlotMetadata, binding: ReaderSlotBinding, ) -> Result<Self, SlotError>
Binds atomic metadata reached through a read-only native mapping.
§Safety
header must reside at the checked slot offset represented by
binding, be readable for 'a, and must not be reached through a
writable mapping in this process.
Sourcepub fn observe(
&self,
expected_sequence: u64,
) -> Result<SlotObservation, SlotError>
pub fn observe( &self, expected_sequence: u64, ) -> Result<SlotObservation, SlotError>
Acquires and validates publication metadata before an owned payload copy.
Sourcepub fn recheck(&self, observation: SlotObservation) -> Result<(), SlotError>
pub fn recheck(&self, observation: SlotObservation) -> Result<(), SlotError>
Rechecks metadata stability after copying hostile bytes to owned storage.
This detects metadata changes, not payload integrity. A malicious writer can mutate bytes without changing metadata; callers must parse every owned payload copy as hostile input.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ReaderSlot<'a>
impl<'a> !UnwindSafe for ReaderSlot<'a>
impl<'a> Freeze for ReaderSlot<'a>
impl<'a> Send for ReaderSlot<'a>
impl<'a> Sync for ReaderSlot<'a>
impl<'a> Unpin for ReaderSlot<'a>
impl<'a> UnsafeUnpin for ReaderSlot<'a>
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