ShmSequencedSlotsProducer

Struct ShmSequencedSlotsProducer 

Source
pub struct ShmSequencedSlotsProducer { /* private fields */ }
Expand description

Single-producer handle over SequencedSlotsLayout4.

v1: single-writer claim/publish (no MPMC claiming).

Implementations§

Source§

impl ShmSequencedSlotsProducer

Source

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 1 for single-ring pipelines where only the final stage releases.
  • Use k for multicast scenarios with k independent consumers.
Source

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).

Source

pub fn try_claim_next(&mut self) -> Result<u64, SequencedSlotsError>

Try to reserve the next sequence.

Source

pub fn publish_bytes( &mut self, bytes: &[u8], ) -> Result<u64, SequencedSlotsError>

Publish bytes as the next sequenced entry.

Source

pub fn publish_claimed_with<F>( &mut self, seq: u64, f: F, ) -> Result<u64, SequencedSlotsError>
where F: FnOnce(&mut [u8]) -> Result<usize, SequencedSlotsError>,

Publish a previously-claimed sequence by writing into the slot buffer.

Trait Implementations§

Source§

impl LaneTx for ShmSequencedSlotsProducer

Source§

fn publish(&mut self, msg: &[u8]) -> Result<(), LaneTxError>

Publish the message.

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
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> Same for T

Source§

type Output = T

Should always be Self
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.