pub struct ScratchPool { /* private fields */ }Expand description
Heap-allocated buffer pool for intermediate results during audio processing.
Each call to buf(frames) returns the next available &mut [f32] of the
requested length. The cursor wraps around when all slots are used.
Uses interior mutability so multiple buffers can be live simultaneously.
§Example
use sesh_sdk::Scratch;
let scratch = Scratch::new();
let frames = 128;
let a = scratch.buf(frames);
let b = scratch.buf(frames);
let c = scratch.buf(frames);
// a, b, c are all valid simultaneouslyImplementations§
Source§impl ScratchPool
impl ScratchPool
Sourcepub fn with_capacity(n: usize, frames_cap: usize) -> Self
pub fn with_capacity(n: usize, frames_cap: usize) -> Self
Create a new scratch pool with n buffers of frames_cap frames each.
Auto Trait Implementations§
impl !Freeze for ScratchPool
impl !RefUnwindSafe for ScratchPool
impl Send for ScratchPool
impl !Sync for ScratchPool
impl Unpin for ScratchPool
impl UnsafeUnpin for ScratchPool
impl UnwindSafe for ScratchPool
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