pub struct SharedRingMpsc;Expand description
Factory for an MPSC pool composed from N Lamport SPSC rings.
Implementations§
Sourcepub fn create_anon_pool(
n_producers: usize,
capacity: usize,
) -> Result<(Vec<MpscProducer>, MpscConsumer), RingError>
pub fn create_anon_pool( n_producers: usize, capacity: usize, ) -> Result<(Vec<MpscProducer>, MpscConsumer), RingError>
Anonymous in-memory pool of N producer rings + one consumer. Skips file create + ftruncate; in-process only.
Sourcepub fn create_pool(
path_prefix: impl AsRef<Path>,
n_producers: usize,
capacity: usize,
) -> Result<(Vec<MpscProducer>, MpscConsumer), RingError>
pub fn create_pool( path_prefix: impl AsRef<Path>, n_producers: usize, capacity: usize, ) -> Result<(Vec<MpscProducer>, MpscConsumer), RingError>
File-backed pool: one file per producer ring. Each ring’s
path is derived from path_prefix by appending .{i}.bin.
Auto Trait Implementations§
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