pub struct PipeBuffer<T: Transcendental, const N: usize> { /* private fields */ }Expand description
Single-producer, single-consumer buffer for intra-graph node connections.
Unlike its name suggests, this is not thread-safe — it is used
exclusively within the single-threaded signal graph. For cross-thread
communication use rill_core::queues.
Implementations§
Source§impl<T: Transcendental, const N: usize> PipeBuffer<T, N>
impl<T: Transcendental, const N: usize> PipeBuffer<T, N>
Sourcepub fn write(&mut self, data: &[T; N])
pub fn write(&mut self, data: &[T; N])
Write a block of data. Subsequent reads will return this data.
Sourcepub fn try_read(&mut self) -> Option<[T; N]>
pub fn try_read(&mut self) -> Option<[T; N]>
Read the latest written data (destructive — clears the valid flag).
Sourcepub fn read_blocking(&mut self) -> [T; N]
pub fn read_blocking(&mut self) -> [T; N]
Busy-wait until data is available, then read destructively.
Sourcepub fn is_caught_up(&self) -> bool
pub fn is_caught_up(&self) -> bool
Whether all writes have been consumed by reads.
Sourcepub fn overwrites(&self) -> usize
pub fn overwrites(&self) -> usize
Number of times the buffer was overwritten before being read.
Trait Implementations§
Source§impl<T: Transcendental + Copy, const N: usize> Clone for PipeBuffer<T, N>
impl<T: Transcendental + Copy, const N: usize> Clone for PipeBuffer<T, N>
Source§impl<T: Transcendental + Debug, const N: usize> Debug for PipeBuffer<T, N>
impl<T: Transcendental + Debug, const N: usize> Debug for PipeBuffer<T, N>
Source§impl<T: Transcendental, const N: usize> Default for PipeBuffer<T, N>
impl<T: Transcendental, const N: usize> Default for PipeBuffer<T, N>
Source§impl<T: Transcendental, const N: usize> SignalBuffer<T> for PipeBuffer<T, N>
impl<T: Transcendental, const N: usize> SignalBuffer<T> for PipeBuffer<T, N>
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> !Freeze for PipeBuffer<T, N>
impl<T, const N: usize> RefUnwindSafe for PipeBuffer<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for PipeBuffer<T, N>
impl<T, const N: usize> Sync for PipeBuffer<T, N>
impl<T, const N: usize> Unpin for PipeBuffer<T, N>where
T: Unpin,
impl<T, const N: usize> UnsafeUnpin for PipeBuffer<T, N>where
T: UnsafeUnpin,
impl<T, const N: usize> UnwindSafe for PipeBuffer<T, N>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