pub trait Buffer<T: Scalar> {
// Required methods
fn capacity(&self) -> usize;
fn len(&self) -> usize;
fn as_slice(&self) -> &[T];
fn as_mut_slice(&mut self) -> &mut [T];
fn fill(&mut self, value: T);
fn copy_from(&mut self, src: &[T]);
fn clear(&mut self);
// Provided methods
fn is_empty(&self) -> bool { ... }
fn is_full(&self) -> bool { ... }
fn stats(&self) -> BufferStats { ... }
fn reset_stats(&mut self) { ... }
}Expand description
Common interface for all buffer types used in the signal graph.
Required Methods§
Sourcefn as_mut_slice(&mut self) -> &mut [T]
fn as_mut_slice(&mut self) -> &mut [T]
Mutable access to the buffer data.
Provided Methods§
Sourcefn stats(&self) -> BufferStats
fn stats(&self) -> BufferStats
Snapshot of performance statistics.
Sourcefn reset_stats(&mut self)
fn reset_stats(&mut self)
Reset performance counters (not the data).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".