AUDIO
Source snapshot · 12 October 2026

API reference / ravet_graph::DynamicGraph

Struct DynamicGraph 

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>

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

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>

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

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)

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>

Reset only the selected graph; proposals retain their prepared history.

pub fn latency_samples(&self) -> u32

Fixed latency enforced for every accepted graph.

pub fn tail(&self) -> Tail

Selected graph’s tail; replacement does not drain the previous tail.

Auto Trait Implementations§

§

impl<S = f32> !Freeze for DynamicGraph<S>

§

impl<S = f32> !RefUnwindSafe for DynamicGraph<S>

§

impl<S = f32> !Sync for DynamicGraph<S>

§

impl<S = f32> !UnwindSafe for DynamicGraph<S>

§

impl<S> Send for DynamicGraph<S>

§

impl<S> Unpin for DynamicGraph<S>

§

impl<S> UnsafeUnpin for DynamicGraph<S>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.