Skip to main content

Sink

Trait Sink 

Source
pub trait Sink<T: Transcendental, const BUF_SIZE: usize>: Node<T, BUF_SIZE> {
    // Required method
    fn consume(
        &mut self,
        ctx: &RenderContext,
        signal_inputs: &[&[T; BUF_SIZE]],
        control_inputs: &[T],
        clock_inputs: &[RenderContext],
        feedback_inputs: &[&[T; BUF_SIZE]],
        tick: &ClockTick,
    ) -> ProcessResult<()>;

    // Provided method
    fn set_playback(&mut self, _playback: Arc<dyn IoPlayback>) { ... }
}
Expand description

Active sink of signals

Sinks consume signal and send it to external destinations. They have no signal outputs, but may have control and clock ports.

Required Methods§

Source

fn consume( &mut self, ctx: &RenderContext, signal_inputs: &[&[T; BUF_SIZE]], control_inputs: &[T], clock_inputs: &[RenderContext], feedback_inputs: &[&[T; BUF_SIZE]], tick: &ClockTick, ) -> ProcessResult<()>

Consume a block of signal

§Arguments
  • clock - Current clock tick
  • signal_inputs - Signal input buffers (one per signal input)
  • control_inputs - Control signal values (one per control input)
  • clock_inputs - Clock signal values (one per clock input)
  • feedback_inputs - Feedback values from previous blocks

Provided Methods§

Source

fn set_playback(&mut self, _playback: Arc<dyn IoPlayback>)

Attach a playback backend. No-op by default; I/O nodes override.

Trait Implementations§

Source§

impl<T, const BUF_SIZE: usize> Processable<T, BUF_SIZE> for Box<dyn Sink<T, BUF_SIZE>>
where T: Transcendental,

Source§

fn process_block( &mut self, ctx: &RenderContext, tick: &ClockTick, ) -> ProcessResult<()>

Process one block of signal samples. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§