pub struct Map<P>(pub P);Expand description
Lift a processor through Option or Result.
This is useful when a processor should only run on present/valid samples while preserving outer framing or error signaling. It changes control-flow shape, not block layout.
§Examples
use dsp_process::{Map, Offset, SplitProcess};
let proc = Map(Offset(3));
let mut state = ();
assert_eq!(proc.process(&mut state, Some(4)), Some(7));
assert_eq!(proc.process(&mut state, None::<i32>), None);Tuple Fields§
§0: PTrait Implementations§
Source§impl<X: Copy, C: SplitInplace<X, S>, S> SplitInplace<X, S> for Map<C>where
Self: SplitProcess<X, X, S>,
impl<X: Copy, C: SplitInplace<X, S>, S> SplitInplace<X, S> for Map<C>where
Self: SplitProcess<X, X, S>,
Source§impl<X: Copy, Y, C: SplitProcess<X, Y, S>, S> SplitProcess<Option<X>, Option<Y>, S> for Map<C>
impl<X: Copy, Y, C: SplitProcess<X, Y, S>, S> SplitProcess<Option<X>, Option<Y>, S> for Map<C>
Source§impl<X: Copy, Y, C: SplitProcess<X, Y, S>, S, E: Copy> SplitProcess<Result<X, E>, Result<Y, E>, S> for Map<C>
impl<X: Copy, Y, C: SplitProcess<X, Y, S>, S, E: Copy> SplitProcess<Result<X, E>, Result<Y, E>, S> for Map<C>
Auto Trait Implementations§
impl<P> Freeze for Map<P>where
P: Freeze,
impl<P> RefUnwindSafe for Map<P>where
P: RefUnwindSafe,
impl<P> Send for Map<P>where
P: Send,
impl<P> Sync for Map<P>where
P: Sync,
impl<P> Unpin for Map<P>where
P: Unpin,
impl<P> UnsafeUnpin for Map<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for Map<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.