pub struct ShmSequencedSlotsProducer { /* private fields */ }Expand description
Single-producer handle over SequencedSlotsLayout4.
v1: single-writer claim/publish (no MPMC claiming).
Implementations§
Source§impl ShmSequencedSlotsProducer
impl ShmSequencedSlotsProducer
Sourcepub fn attach(
opts: &AttachOptions,
lane: &str,
refcnt_on_publish: u32,
active_gating: usize,
) -> Result<Self, BackingError>
pub fn attach( opts: &AttachOptions, lane: &str, refcnt_on_publish: u32, active_gating: usize, ) -> Result<Self, BackingError>
Attach a producer.
refcnt_on_publish controls the slot refcount initialized for each published entry.
- Use
1for single-ring pipelines where only the final stage releases. - Use
kfor multicast scenarios withkindependent consumers.
Sourcepub fn window_capacity(&self) -> u64
pub fn window_capacity(&self) -> u64
Maximum number of outstanding unpublished/ungated sequences permitted by this backing.
This is currently min(INDEXBUS_QUEUE_CAPACITY, INDEXBUS_SLOTS_CAPACITY).
Sourcepub fn try_claim_next(&mut self) -> Result<u64, SequencedSlotsError>
pub fn try_claim_next(&mut self) -> Result<u64, SequencedSlotsError>
Try to reserve the next sequence.
Sourcepub fn publish_bytes(
&mut self,
bytes: &[u8],
) -> Result<u64, SequencedSlotsError>
pub fn publish_bytes( &mut self, bytes: &[u8], ) -> Result<u64, SequencedSlotsError>
Publish bytes as the next sequenced entry.
Sourcepub fn publish_claimed_with<F>(
&mut self,
seq: u64,
f: F,
) -> Result<u64, SequencedSlotsError>
pub fn publish_claimed_with<F>( &mut self, seq: u64, f: F, ) -> Result<u64, SequencedSlotsError>
Publish a previously-claimed sequence by writing into the slot buffer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ShmSequencedSlotsProducer
impl !RefUnwindSafe for ShmSequencedSlotsProducer
impl Send for ShmSequencedSlotsProducer
impl Sync for ShmSequencedSlotsProducer
impl Unpin for ShmSequencedSlotsProducer
impl !UnwindSafe for ShmSequencedSlotsProducer
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