Struct Dynamic Graph
pub struct DynamicGraph<S: GraphSample = f32> { /* private fields */ }Expand description
Audio-owned active graph with one prepared FIFO replacement per valid block. Process/reset never destroy graphs; retired ownership returns to control. Construct and drop both endpoints only outside callbacks. Each graph keeps its own 64 MiB cap; total in-flight graph/node memory is consumer-budgeted.
Implementations§
§impl<S: GraphSample> DynamicGraph<S>
impl<S: GraphSample> DynamicGraph<S>
pub fn new(
initial: Box<Graph<S>>,
capacity: usize,
) -> Result<(GraphControl<S>, Self), GraphOfferError<S>>
pub fn new( initial: Box<Graph<S>>, capacity: usize, ) -> Result<(GraphControl<S>, Self), GraphOfferError<S>>
Allocates two bounded ownership queues around a prepared active graph. Returns initial graph ownership if preparation/capacity validation fails.
pub fn configuration(&self) -> ProcessConfig
pub fn configuration(&self) -> ProcessConfig
Fixed prepared configuration shared by all accepted graphs. Reading it does not prepare/restart nodes or alter handoff/retirement ownership.
pub fn start_audio(
&mut self,
) -> Result<DynamicGraphAudioSession<'_, S>, GraphStatus>
pub fn start_audio( &mut self, ) -> Result<DynamicGraphAudioSession<'_, S>, GraphStatus>
Enter explicit owner-confined node start/stop lifecycle. While guarded, candidates start before old nodes stop; failed candidates retire while old rendering continues. Normal unguarded portable behavior is unchanged.
pub fn process(
&mut self,
block: &mut ProcessBlock<'_, '_, '_, S>,
) -> DynamicGraphStatus
pub fn process( &mut self, block: &mut ProcessBlock<'_, '_, '_, S>, ) -> DynamicGraphStatus
Validate outer input, replace at most one graph, then render. Replacement starts the new prepared history; there is no crossfade, old-tail drain or rollback. Invalid blocks silence output without consuming a queued graph.
pub fn reset(&mut self)
pub fn reset(&mut self)
Reset only the currently selected graph; proposed graphs retain their already-prepared histories until selected. No graph destruction occurs.
pub fn try_reset(&mut self) -> Result<(), GraphStatus>
pub fn try_reset(&mut self) -> Result<(), GraphStatus>
Reset only the selected graph; proposals retain their prepared history.
pub fn latency_samples(&self) -> u32
pub fn latency_samples(&self) -> u32
Fixed latency enforced for every accepted graph.
pub fn tail(&self) -> Tail
pub fn tail(&self) -> Tail
Selected graph’s tail; replacement does not drain the previous tail.