Skip to main content

ActiveNode

Trait ActiveNode 

Source
pub trait ActiveNode<T: Transcendental, const BUF_SIZE: usize>: IoNode<T, BUF_SIZE> {
    // Required method
    fn run(
        &mut self,
        tick: Box<dyn FnMut(u64, f32)>,
        running: Arc<AtomicBool>,
    ) -> IoResult<()>;
}
Expand description

A node that drives graph processing through its I/O backend.

The active node is the single node in a graph that hosts the callback loop. It receives a tick closure from [Graph] and registers it as the process callback on its backend.

Only one node per graph implements this trait — it must also implement IoNode.

Required Methods§

Source

fn run( &mut self, tick: Box<dyn FnMut(u64, f32)>, running: Arc<AtomicBool>, ) -> IoResult<()>

Run graph processing through this node’s I/O backend.

The tick closure is called once per signal block with (sample_pos, sample_rate). The implementation must register it as a process callback on the backend and block until running becomes false.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§