Skip to main content

GraphExecutor

Struct GraphExecutor 

Source
pub struct GraphExecutor<T: Transcendental, const BUF_SIZE: usize> { /* private fields */ }
Expand description

Executor for a signal graph that processes nodes in topological order.

This is a prototype that outlines the structure. In a real implementation, the executor would hold a concrete graph and iterate over its nodes.

Implementations§

Source§

impl<T: Transcendental, const BUF_SIZE: usize> GraphExecutor<T, BUF_SIZE>

Source

pub fn new() -> Self

Create a new executor from an existing graph.

Source

pub fn process_block(&mut self) -> Result<(), Box<dyn Error>>

Process one block of audio.

This advances the clock, obtains topological order, processes each node by pulling inputs, calling appropriate processing method, and pushing outputs.

§Returns

Ok(()) if processing succeeded, or an error if something went wrong.

§Algorithm (conceptual)
  1. Advance the clock (if the graph provides a clock source).
  2. Obtain topological order (if the graph provides it).
  3. For each node in order: a. Gather input data by calling pull on each input port (ActivePort trait). b. Determine node type (Source/Processor/Sink) via metadata. c. Call the appropriate processing method (generate/process/consume). d. Push output data by calling push on each output port.
  4. Handle errors (disconnected ports, missing data).

Auto Trait Implementations§

§

impl<T, const BUF_SIZE: usize> Freeze for GraphExecutor<T, BUF_SIZE>

§

impl<T, const BUF_SIZE: usize> RefUnwindSafe for GraphExecutor<T, BUF_SIZE>
where T: RefUnwindSafe,

§

impl<T, const BUF_SIZE: usize> Send for GraphExecutor<T, BUF_SIZE>

§

impl<T, const BUF_SIZE: usize> Sync for GraphExecutor<T, BUF_SIZE>

§

impl<T, const BUF_SIZE: usize> Unpin for GraphExecutor<T, BUF_SIZE>
where T: Unpin,

§

impl<T, const BUF_SIZE: usize> UnsafeUnpin for GraphExecutor<T, BUF_SIZE>

§

impl<T, const BUF_SIZE: usize> UnwindSafe for GraphExecutor<T, BUF_SIZE>
where 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> AsAny for T
where T: 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert to &dyn std::any::Any
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert to &mut dyn std::any::Any
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<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.