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>
impl<T: Transcendental, const BUF_SIZE: usize> GraphExecutor<T, BUF_SIZE>
Sourcepub fn process_block(&mut self) -> Result<(), Box<dyn Error>>
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)
- Advance the clock (if the graph provides a clock source).
- Obtain topological order (if the graph provides it).
- For each node in order:
a. Gather input data by calling
pullon 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 callingpushon each output port. - 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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more