pub struct FanOutBuffer<T, const N: usize, const CONSUMERS: usize>where
T: Transcendental,{ /* private fields */ }Expand description
Buffer for broadcasting from one producer to multiple consumers
Implementations§
Source§impl<T, const N: usize, const CONSUMERS: usize> FanOutBuffer<T, N, CONSUMERS>where
T: Transcendental,
impl<T, const N: usize, const CONSUMERS: usize> FanOutBuffer<T, N, CONSUMERS>where
T: Transcendental,
Sourcepub fn new() -> FanOutBuffer<T, N, CONSUMERS>
pub fn new() -> FanOutBuffer<T, N, CONSUMERS>
Create new fan-out buffer
Sourcepub fn try_read(&self, consumer_id: usize) -> Option<[T; N]>
pub fn try_read(&self, consumer_id: usize) -> Option<[T; N]>
Try to read for a specific consumer
Sourcepub fn has_new_data(&self, consumer_id: usize) -> bool
pub fn has_new_data(&self, consumer_id: usize) -> bool
Check if a specific consumer has new data
Sourcepub const fn consumer_count(&self) -> usize
pub const fn consumer_count(&self) -> usize
Get the number of consumers
Sourcepub fn current_version(&self) -> usize
pub fn current_version(&self) -> usize
Get current version
Sourcepub fn last_read_version(&self, consumer_id: usize) -> Option<usize>
pub fn last_read_version(&self, consumer_id: usize) -> Option<usize>
Get last read version for consumer
Trait Implementations§
Source§impl<T, const N: usize, const CONSUMERS: usize> Clone for FanOutBuffer<T, N, CONSUMERS>where
T: Transcendental + Copy,
impl<T, const N: usize, const CONSUMERS: usize> Clone for FanOutBuffer<T, N, CONSUMERS>where
T: Transcendental + Copy,
Source§fn clone(&self) -> FanOutBuffer<T, N, CONSUMERS>
fn clone(&self) -> FanOutBuffer<T, N, CONSUMERS>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T, const N: usize, const CONSUMERS: usize> Debug for FanOutBuffer<T, N, CONSUMERS>where
T: Transcendental + Debug,
impl<T, const N: usize, const CONSUMERS: usize> Debug for FanOutBuffer<T, N, CONSUMERS>where
T: Transcendental + Debug,
Source§impl<T, const N: usize, const CONSUMERS: usize> Default for FanOutBuffer<T, N, CONSUMERS>where
T: Transcendental,
impl<T, const N: usize, const CONSUMERS: usize> Default for FanOutBuffer<T, N, CONSUMERS>where
T: Transcendental,
Source§fn default() -> FanOutBuffer<T, N, CONSUMERS>
fn default() -> FanOutBuffer<T, N, CONSUMERS>
Returns the “default value” for a type. Read more
Source§impl<T, const N: usize, const CONSUMERS: usize> SignalBuffer<T> for FanOutBuffer<T, N, CONSUMERS>where
T: Transcendental,
impl<T, const N: usize, const CONSUMERS: usize> SignalBuffer<T> for FanOutBuffer<T, N, CONSUMERS>where
T: Transcendental,
Source§fn stats(&self) -> BufferStats
fn stats(&self) -> BufferStats
Get a snapshot of current buffer statistics
Source§fn reset_stats(&mut self)
fn reset_stats(&mut self)
Reset all statistics to zero Read more
Auto Trait Implementations§
impl<T, const N: usize, const CONSUMERS: usize> !Freeze for FanOutBuffer<T, N, CONSUMERS>
impl<T, const N: usize, const CONSUMERS: usize> !RefUnwindSafe for FanOutBuffer<T, N, CONSUMERS>
impl<T, const N: usize, const CONSUMERS: usize> Send for FanOutBuffer<T, N, CONSUMERS>
impl<T, const N: usize, const CONSUMERS: usize> Sync for FanOutBuffer<T, N, CONSUMERS>
impl<T, const N: usize, const CONSUMERS: usize> Unpin for FanOutBuffer<T, N, CONSUMERS>where
T: Unpin,
impl<T, const N: usize, const CONSUMERS: usize> UnsafeUnpin for FanOutBuffer<T, N, CONSUMERS>where
T: UnsafeUnpin,
impl<T, const N: usize, const CONSUMERS: usize> UnwindSafe for FanOutBuffer<T, N, CONSUMERS>where
T: UnwindSafe,
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