Struct AddFrame

Source
pub struct AddFrame<S, F, const N: usize>
where S: Signal<N>, S::Frame: Frame<N, Signed = F>, F: Frame<N>,
{ /* private fields */ }
Expand description

Adds a constant Frame to each Frame from a Signal.

Trait Implementations§

Source§

impl<S, F, const N: usize> Clone for AddFrame<S, F, N>
where S: Signal<N> + Clone, S::Frame: Frame<N, Signed = F>, F: Frame<N> + Clone,

Source§

fn clone(&self) -> AddFrame<S, F, N>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S, F, const N: usize> Signal<N> for AddFrame<S, F, N>
where S: Signal<N>, S::Frame: Frame<N, Signed = F>, F: Frame<N>,

Source§

type Frame = <S as Signal<N>>::Frame

The Frame type returned by this Signal.
Source§

fn next(&mut self) -> Option<Self::Frame>

Advances Self and returns the next Frame, or None if there are no more to yield.
Source§

fn sig_next(&mut self) -> Self::Frame

Similar to [next], but will always yield a Frame. Yields Frame::EQUILIBRIUM if there are no more actual Frames to yield.
Source§

fn by_ref(&mut self) -> &mut Self
where Self: Sized,

Borrows this Signal rather than consuming it. Read more
Source§

fn map<F, M, const NF: usize>(self, func: M) -> Map<Self, F, M, N, NF>
where Self: Sized, F: Frame<NF>, M: FnMut(Self::Frame) -> F,

Creates a new Signal that applies a function to each Frame of Self.
Source§

fn zip_map<O, F, M, const NO: usize, const NF: usize>( self, other: O, func: M, ) -> ZipMap<Self, O, F, M, N, NO, NF>
where Self: Sized, O: Signal<NO>, F: Frame<NF>, M: FnMut(Self::Frame, O::Frame) -> F,

Creates a new Signal that applies a function to each pair of Frames in Self and another Signal.
Source§

fn add_signal<B>(self, other: B) -> AddSignal<Self, B, N>
where Self: Sized, B: Signal<N>, Self::Frame: Frame<N, Signed = <B::Frame as Frame<N>>::Signed>,

Creates a new Signal that yields the sum of pairs of Frames yielded by Self and another Signal in lockstep.
Source§

fn mul_signal<B>(self, other: B) -> MulSignal<Self, B, N>
where Self: Sized, B: Signal<N>, Self::Frame: Frame<N, Float = <B::Frame as Frame<N>>::Float>,

Creates a new Signal that yields the product of pairs of Frames yielded by Self and another Signal in lockstep.
Source§

fn add_frame<F>(self, frame: F) -> AddFrame<Self, F, N>
where Self: Sized, Self::Frame: Frame<N, Signed = F>, F: Frame<N>,

Creates a new Signal that yields each Frame of a Signal summed with a constant Frame.
Source§

fn mul_frame<F>(self, frame: F) -> MulFrame<Self, F, N>
where Self: Sized, Self::Frame: Frame<N, Float = F>, F: Frame<N>,

Creates a new Signal that yields each Frame of a Signal multiplied with a constant Frame.
Source§

fn add_amp<X>(self, amp: X) -> AddAmp<Self, X, N>
where Self: Sized, Self::Frame: Frame<N>, <Self::Frame as Frame<N>>::Sample: Sample<Signed = X>, X: Sample,

Creates a new Signal that yields each Frame of a Signal with each channel summed with a constant Sample.
Source§

fn mul_amp<X>(self, amp: X) -> MulAmp<Self, X, N>
where Self: Sized, Self::Frame: Frame<N>, <Self::Frame as Frame<N>>::Sample: Sample<Float = X>, X: Sample,

Creates a new Signal that yields each Frame of a Signal with each channel multiplied with a constant Sample.
Source§

fn delay(self, n_frames: usize) -> Delay<Self, N>
where Self: Sized,

Delays Self by a given number of frames. The delay is performed by yielding Frame::EQUILIBRIUM that number of times before continuing to yield frames from Self.
Source§

fn inspect<F>(self, func: F) -> Inspect<Self, F, N>
where Self: Sized, F: FnMut(&Self::Frame),

Calls an inspection function on each Frame yielded by this Signal, and then passes the Frame through. Read more
Source§

fn take(self, n: usize) -> Take<Self, N>
where Self: Sized,

Returns a new Signal that yields only the first N Frames of Self. Read more
Source§

fn into_iter(self) -> IntoIter<Self, N>
where Self: Sized,

Converts this Signal into an Iterator yielding Frames. Read more

Auto Trait Implementations§

§

impl<S, F, const N: usize> Freeze for AddFrame<S, F, N>
where <S as Signal<N>>::Frame: Sized, S: Freeze, F: Freeze,

§

impl<S, F, const N: usize> RefUnwindSafe for AddFrame<S, F, N>
where <S as Signal<N>>::Frame: Sized, S: RefUnwindSafe, F: RefUnwindSafe,

§

impl<S, F, const N: usize> Send for AddFrame<S, F, N>
where <S as Signal<N>>::Frame: Sized, S: Send, F: Send,

§

impl<S, F, const N: usize> Sync for AddFrame<S, F, N>
where <S as Signal<N>>::Frame: Sized, S: Sync, F: Sync,

§

impl<S, F, const N: usize> Unpin for AddFrame<S, F, N>
where <S as Signal<N>>::Frame: Sized, S: Unpin, F: Unpin,

§

impl<S, F, const N: usize> UnwindSafe for AddFrame<S, F, N>
where <S as Signal<N>>::Frame: Sized, S: UnwindSafe, F: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.