pub struct FanOutBuffer<T: Transcendental, const N: usize, const CONSUMERS: usize> { /* private fields */ }Expand description
Buffer for broadcasting from one producer to multiple consumers
Implementations§
Source§impl<T: Transcendental, const N: usize, const CONSUMERS: usize> FanOutBuffer<T, N, CONSUMERS>
impl<T: Transcendental, const N: usize, const CONSUMERS: usize> FanOutBuffer<T, N, CONSUMERS>
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: Transcendental + Copy, const N: usize, const CONSUMERS: usize> Clone for FanOutBuffer<T, N, CONSUMERS>
impl<T: Transcendental + Copy, const N: usize, const CONSUMERS: usize> Clone for FanOutBuffer<T, N, CONSUMERS>
Source§impl<T: Transcendental + Debug, const N: usize, const CONSUMERS: usize> Debug for FanOutBuffer<T, N, CONSUMERS>
impl<T: Transcendental + Debug, const N: usize, const CONSUMERS: usize> Debug for FanOutBuffer<T, N, CONSUMERS>
Source§impl<T: Transcendental, const N: usize, const CONSUMERS: usize> Default for FanOutBuffer<T, N, CONSUMERS>
impl<T: Transcendental, const N: usize, const CONSUMERS: usize> Default for FanOutBuffer<T, N, CONSUMERS>
Source§impl<T: Transcendental, const N: usize, const CONSUMERS: usize> SignalBuffer<T> for FanOutBuffer<T, N, CONSUMERS>
impl<T: Transcendental, const N: usize, const CONSUMERS: usize> SignalBuffer<T> for FanOutBuffer<T, N, CONSUMERS>
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