pub struct Chunk<P>(pub P);Expand description
Elementwise fixed-size chunk lifting.
Adapt a X -> Y processor into a [X; N] -> [Y; N] processor
by flattening input and output.
This is the simplest array-lifting adapter and is often the right choice when a scalar stage should run elementwise over fixed-size chunks with no rate change and no frame semantics beyond flattening.
Prefer the more specific adapters when the inner stage consumes or produces
grouped samples (ChunkIn, ChunkOut, ChunkInOut) or when stream phase is
part of the semantics (Interpolator, Decimator).
§Examples
use dsp_process::{Chunk, Offset, Process, Split};
let mut p = Split::stateless(Chunk(Offset(3)));
assert_eq!(p.process([1, 2, 3]), [4, 5, 6]);Tuple Fields§
§0: PTrait Implementations§
impl<P: Copy> Copy for Chunk<P>
Source§impl<C: SplitInplace<X, S>, S, X: Copy, const N: usize> SplitInplace<[X; N], S> for Chunk<C>
impl<C: SplitInplace<X, S>, S, X: Copy, const N: usize> SplitInplace<[X; N], S> for Chunk<C>
Source§impl<C: SplitProcess<X, Y, S>, S, X: Copy, Y, const N: usize> SplitProcess<[X; N], [Y; N], S> for Chunk<C>
impl<C: SplitProcess<X, Y, S>, S, X: Copy, Y, const N: usize> SplitProcess<[X; N], [Y; N], S> for Chunk<C>
Auto Trait Implementations§
impl<P> Freeze for Chunk<P>where
P: Freeze,
impl<P> RefUnwindSafe for Chunk<P>where
P: RefUnwindSafe,
impl<P> Send for Chunk<P>where
P: Send,
impl<P> Sync for Chunk<P>where
P: Sync,
impl<P> Unpin for Chunk<P>where
P: Unpin,
impl<P> UnsafeUnpin for Chunk<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for Chunk<P>where
P: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, X, S, T, const L: usize> SplitViewInplace<ViewMut<'a, X, FrameMajor, L>, S> for T
impl<'a, X, S, T, const L: usize> SplitViewInplace<ViewMut<'a, X, FrameMajor, L>, S> for T
Source§fn inplace_view(&self, state: &mut S, xy: ViewMut<'a, X, FrameMajor, L>)
fn inplace_view(&self, state: &mut S, xy: ViewMut<'a, X, FrameMajor, L>)
Process one typed view in place.
Source§impl<'a, 'b, X, Y, S, T, const L: usize> SplitViewProcess<View<'a, X, FrameMajor, L>, ViewMut<'b, Y, FrameMajor, L>, S> for T
impl<'a, 'b, X, Y, S, T, const L: usize> SplitViewProcess<View<'a, X, FrameMajor, L>, ViewMut<'b, Y, FrameMajor, L>, S> for T
Source§fn process_view(
&self,
state: &mut S,
x: View<'a, X, FrameMajor, L>,
y: ViewMut<'b, Y, FrameMajor, L>,
)
fn process_view( &self, state: &mut S, x: View<'a, X, FrameMajor, L>, y: ViewMut<'b, Y, FrameMajor, L>, )
Process one typed input view into one typed output view.