pub struct Graph<T: Transcendental, const BUF_SIZE: usize> {
pub system_clock: Option<Arc<SystemClock>>,
/* private fields */
}Expand description
Immutable signal graph with static DAG topology.
Once built the graph cannot be modified. The graph owns no processing
logic — it is a pure topology description. Processing is driven by
port-level methods (pre_process, snapshot_feedback, propagate)
called from external code (e.g. a real-time signal callback or an
offline renderer).
Fields§
§system_clock: Option<Arc<SystemClock>>Optional shared system clock, updated by external sync sources (MIDI, JACK transport).
When set, the I/O callback reads BPM from it and creates ClockTick::with_tempo.
Implementations§
Source§impl<T: Transcendental, const BUF_SIZE: usize> Graph<T, BUF_SIZE>
impl<T: Transcendental, const BUF_SIZE: usize> Graph<T, BUF_SIZE>
Sourcepub fn nodes(&self) -> &[NodeVariant<T, BUF_SIZE>]
pub fn nodes(&self) -> &[NodeVariant<T, BUF_SIZE>]
Borrow the node array (read-only).
Sourcepub fn current_tick(&self) -> ClockTick
pub fn current_tick(&self) -> ClockTick
Return the current clock tick.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Return the number of nodes in the graph.
Sourcepub fn topo_order(&self) -> &[usize]
pub fn topo_order(&self) -> &[usize]
Return the topological ordering of node indices.
Sourcepub fn resources(&self) -> &[GraphResource]
pub fn resources(&self) -> &[GraphResource]
Access the named resources (tape loops, etc.) allocated for this graph.
Sourcepub fn process_block(&mut self, tick: &ClockTick) -> ProcessResult<()>
pub fn process_block(&mut self, tick: &ClockTick) -> ProcessResult<()>
Process one block of signal data driven by an external ClockTick.
Called from the backend’s process callback. Performs:
- Drains the graph’s actor mailbox (applies queued
SetParameters). - Creates a
RenderContextfrom the tick. - Calls
process_blockon the source node and recursively propagates through the DAG viaPort::propagate. - Sends the tick to the parent
ActorRef(if any).
The graph is !Send + !Sync — it stays on the I/O callback thread.
Sourcepub fn into_processing_state(self) -> ProcessingState<T, BUF_SIZE>
pub fn into_processing_state(self) -> ProcessingState<T, BUF_SIZE>
Consume the graph and return a [ProcessingState] that owns all
parts needed for the I/O callback loop.
ProcessingState is !Send + !Sync — it stays on the I/O thread
and is moved into the backend’s process callback closure.
Sourcepub fn handle(&self) -> ActorRef<CommandEnum>
pub fn handle(&self) -> ActorRef<CommandEnum>
Obtain an ActorRef for sending commands to this graph.