pub struct Receiver<T> { /* private fields */ }Expand description
A receiver endpoint for a VMO-backed FIFO queue.
Implementations§
Source§impl<T: FromBytes + IntoBytes + KnownLayout + Copy> Receiver<T>
impl<T: FromBytes + IntoBytes + KnownLayout + Copy> Receiver<T>
pub fn new(vmo: Vmo, capacity: u32) -> Result<Self, Status>
pub fn is_empty(&self) -> bool
pub fn capacity(&self) -> u32
pub fn index(&self) -> u64
pub fn vmo(&self) -> &Vmo
pub fn payload_region_offset(&self) -> usize
Sourcepub fn peek(&mut self) -> Result<Message<'_, T>, Status>
pub fn peek(&mut self) -> Result<Message<'_, T>, Status>
Peek at the next message without incrementing the read index.
Sourcepub fn claim(&self) -> Result<Message<'_, T>, Status>
pub fn claim(&self) -> Result<Message<'_, T>, Status>
Claims the next message from the queue for concurrent processing across a pool of threads.
Sourcepub fn claim_with<F, R>(
&self,
on_claim: F,
) -> Result<(Message<'_, T>, R), Status>
pub fn claim_with<F, R>( &self, on_claim: F, ) -> Result<(Message<'_, T>, R), Status>
Claims the next message from the queue and invokes on_claim before releasing the queue’s
claim lock, allowing ordered setup steps (such as blob registration) to complete before
subsequent messages are claimed by other worker threads.
Sourcepub fn will_maybe_reenter(&self)
pub fn will_maybe_reenter(&self)
Notifies the receiver that the current worker thread (after popping its message) is about to perform an operation that may block waiting for a subsequent message on this queue. If all other workers are sleeping and unread messages were already queued before the waiter flag was armed, wakes a sleeping worker to process them.
Sourcepub fn payload_slice(&self, vmo_offset: u32, len: u32) -> PtrByteSlice<'_> ⓘ
pub fn payload_slice(&self, vmo_offset: u32, len: u32) -> PtrByteSlice<'_> ⓘ
Returns a raw slice pointer to the specified payload region.
§Panics
Panics if the vmo_offset + len exceeds the bounds of the VMO.
Sourcepub fn payload_mut_slice(
&mut self,
vmo_offset: u32,
len: u32,
) -> MutPtrByteSlice<'_>
pub fn payload_mut_slice( &mut self, vmo_offset: u32, len: u32, ) -> MutPtrByteSlice<'_>
Returns a raw mutable slice pointer to the specified payload region.
§Panics
Panics if the vmo_offset + len exceeds the bounds of the VMO.