AUDIO
Source snapshot · 12 October 2026

API reference / ravet_graph::TypedChainAudioSession

Struct TypedChainAudioSession 

pub struct TypedChainAudioSession<'a, S: GraphSample, T: StageTuple<S>> { /* private fields */ }
Expand description

Canonical non-Send audio-session guard with typed readonly access and bypass. Finish/drop before CONTROL mutation, extraction or transfer. Do not forget it: a forgotten guard leaves the audio owner live (see TypedChain), which is misuse and not a supported way to hand the chain to another thread.

The guard is not Send:

use ravet_graph::TypedChainAudioSession;
use ravet_gain::GainProcessor;
fn send<T:Send>() {}
send::<TypedChainAudioSession<'static,f32,(GainProcessor,)>>();

A live stage() borrow excludes process on the session:

use ravet_graph::{StageAt,TypedChainAudioSession};
use ravet_foundation::{ProcessBlock,Processor};
fn overlap<T: StageAt<f32,0>>(session:&mut TypedChainAudioSession<'_,f32,T>, block:&mut ProcessBlock<'_,'_,'_,f32>) {
    let stage=session.stage::<0>();
    let _=session.process(block);
    let _=stage.latency_samples();
}

… and excludes set_bypassed:

use ravet_graph::{StageAt,TypedChainAudioSession};
use ravet_foundation::Processor;
fn overlap<T: StageAt<f32,0>>(session:&mut TypedChainAudioSession<'_,f32,T>) {
    let stage=session.stage::<0>();
    session.set_bypassed::<0>(true);
    let _=stage.latency_samples();
}

Positive companion: read first, then mutate and render.

use ravet_graph::{StageAt,TypedChainAudioSession};
use ravet_foundation::{ProcessBlock,Processor};
fn ordered<T: StageAt<f32,0>>(session:&mut TypedChainAudioSession<'_,f32,T>, block:&mut ProcessBlock<'_,'_,'_,f32>) {
    let latency=session.stage::<0>().latency_samples();
    session.set_bypassed::<0>(true);
    let _=session.process(block);
    let _=latency;
}

Implementations§

§

impl<S: GraphSample, T: StageTuple<S>> TypedChainAudioSession<'_, S, T>

pub fn process(&mut self, b: &mut ProcessBlock<'_, '_, '_, S>) -> GraphStatus

pub fn reset(&mut self)

pub fn try_reset(&mut self) -> Result<(), GraphStatus>

Preserve the first fault until the complete reset succeeds.

pub fn stage<const I: usize>(&self) -> &<T as StageAt<S, I>>::Processor
where T: StageAt<S, I>,

pub fn set_bypassed<const I: usize>(&mut self, value: bool)
where T: StageAt<S, I>,

pub fn is_bypassed<const I: usize>(&self) -> bool
where T: StageAt<S, I>,

pub fn latency_samples(&self) -> u32

pub fn tail(&self) -> Tail

pub fn finish(self)

Auto Trait Implementations§

§

impl<'a, S, T> !RefUnwindSafe for TypedChainAudioSession<'a, S, T>

§

impl<'a, S, T> !Send for TypedChainAudioSession<'a, S, T>

§

impl<'a, S, T> !Sync for TypedChainAudioSession<'a, S, T>

§

impl<'a, S, T> !UnwindSafe for TypedChainAudioSession<'a, S, T>

§

impl<'a, S, T> Freeze for TypedChainAudioSession<'a, S, T>

§

impl<'a, S, T> Unpin for TypedChainAudioSession<'a, S, T>

§

impl<'a, S, T> UnsafeUnpin for TypedChainAudioSession<'a, S, T>

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.