pub struct BlockPortValues { /* private fields */ }Expand description
Block-oriented port values for efficient processing
Implementations§
Source§impl BlockPortValues
impl BlockPortValues
pub fn new(block_size: usize) -> Self
pub fn block_size(&self) -> usize
pub fn get_buffer(&self, port: PortId) -> Option<&[f64]>
pub fn get_buffer_mut(&mut self, port: PortId) -> &mut Vec<f64>
pub fn frame(&self, index: usize) -> PortValues
Sourcepub fn frame_into(&self, index: usize, dst: &mut PortValues)
pub fn frame_into(&self, index: usize, dst: &mut PortValues)
Read frame index into an existing PortValues, reusing its allocation.
Clears dst and refills it from each port buffer at index. Unlike Self::frame, this
performs no allocation once dst has been warmed with the same key set, which lets
block loops (e.g. the default GraphModule::process_block) avoid a fresh
PortValues per frame.
pub fn set_frame(&mut self, index: usize, values: PortValues)
Sourcepub fn set_frame_ref(&mut self, index: usize, values: &PortValues)
pub fn set_frame_ref(&mut self, index: usize, values: &PortValues)
Write a borrowed PortValues into frame index, without taking ownership.
The by-reference companion to Self::set_frame, so a caller can reuse a single output
PortValues across every frame of a block instead of moving (and reallocating) one
per frame.
pub fn clear(&mut self)
Auto Trait Implementations§
impl Freeze for BlockPortValues
impl RefUnwindSafe for BlockPortValues
impl Send for BlockPortValues
impl Sync for BlockPortValues
impl Unpin for BlockPortValues
impl UnsafeUnpin for BlockPortValues
impl UnwindSafe for BlockPortValues
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