Skip to main content

Merge

Struct Merge 

Source
pub struct Merge<T, F> {
    pub f: F,
    /* private fields */
}
Expand description

Combine two signals with a function

Fields§

§f: F

Implementations§

Source§

impl<T, F> Merge<T, F>
where F: Fn(T, T) -> T,

Source

pub fn new(f: F) -> Self

Trait Implementations§

Source§

impl<T, F> Module for Merge<T, F>
where T: Send, F: Fn(T, T) -> T + Send,

Source§

type In = (T, T)

Input signal type (e.g., f64 for mono, (f64, f64) for stereo)
Source§

type Out = T

Output signal type
Source§

fn tick(&mut self, (a, b): Self::In) -> Self::Out

Process a single sample, advancing internal state by one time step. Read more
Source§

fn reset(&mut self)

Reset internal state to initial conditions. Read more
Source§

fn process(&mut self, input: &[Self::In], output: &mut [Self::Out])
where Self::In: Clone,

Process a block of samples for efficiency. Read more
Source§

fn set_sample_rate(&mut self, _sample_rate: f64)

Notify module of sample rate changes. Read more

Auto Trait Implementations§

§

impl<T, F> Freeze for Merge<T, F>
where F: Freeze,

§

impl<T, F> RefUnwindSafe for Merge<T, F>

§

impl<T, F> Send for Merge<T, F>
where F: Send, T: Send,

§

impl<T, F> Sync for Merge<T, F>
where F: Sync, T: Sync,

§

impl<T, F> Unpin for Merge<T, F>
where F: Unpin, T: Unpin,

§

impl<T, F> UnsafeUnpin for Merge<T, F>
where F: UnsafeUnpin,

§

impl<T, F> UnwindSafe for Merge<T, F>
where F: UnwindSafe, T: 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> 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<M> ModuleExt for M
where M: Module,

Source§

fn then<M: Module<In = Self::Out>>(self, next: M) -> Chain<Self, M>

Chain this module with another (sequential composition: >>>)
Source§

fn parallel<M: Module>(self, other: M) -> Parallel<Self, M>

Run two modules in parallel (***)
Source§

fn fanout<M: Module<In = Self::In>>(self, other: M) -> Fanout<Self, M>
where Self::In: Clone,

Split input to two parallel processors (&&&)
Source§

fn map<F, U>(self, f: F) -> Map<Self, F>
where F: Fn(Self::Out) -> U,

Transform output with a pure function
Source§

fn contramap<F, U>(self, f: F) -> Contramap<Self, F, U>
where F: Fn(U) -> Self::In,

Transform input with a pure function
Source§

fn feedback<F>(self, combine: F) -> Feedback<Self, F>
where Self::Out: Default + Clone,

Create a feedback loop with a single-sample unit delay. Read more
Source§

fn first<C>(self) -> First<Self, C>

Apply this module only to the first element of a tuple
Source§

fn second<C>(self) -> Second<Self, C>

Apply this module only to the second element of a tuple
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.