AUDIO
Source snapshot · 12 October 2026

API reference / ravet_device::PreparedOutput

Struct PreparedOutput 

pub struct PreparedOutput<P: Processor> { /* private fields */ }
Expand description

Prepared output-only f32 rendering, independently testable without hardware. Construction may allocate; render uses bounded scratch without allocation. Processor implementations must obey the portable callback contract.

Implementations§

§

impl<P: Processor> PreparedOutput<P>

pub fn new( processor: P, sample_rate: u32, channels: usize, maximum_frames: usize, ) -> Result<Self, PrepareError>

Prepare 1..=64 output channels and 1..=65,536 scratch frames per channel. Input/events/auxiliary capacities are zero. A failed prepare must leave the supplied processor inactive, as required by Processor.

pub fn new_owned( processor: P, sample_rate: u32, channels: usize, maximum_frames: usize, ) -> Result<Self, PreparedOutputFailure<P>>

Prepare off callback while returning the original processor on ordinary failure. Scratch is fallibly allocated before Processor::prepare, so a scratch allocation failure does not mutate the processor. A failed foreign prepare must obey Processor’s inactive contract; foreign panic is exceptional.

pub fn into_processor(self) -> P

Consume a directly owned stopped renderer on control, deactivate its processor once and return that original owner. Scratch/counters retire on the calling control thread. Reopening requires explicit preparation; no reader seek/reset is hidden here. A foreign deactivation panic is exceptional.

pub fn render(&mut self, output: &mut [f32])

Fill an interleaved device buffer, partitioning oversized callbacks. A malformed partial frame silences the entire buffer without invoking DSP or advancing its position. Processor faults silence that sub-block. Silence status is enforced even if a processor left nonzero samples. Panics are contained by the live adapter, not this offline method.

pub fn statistics(&self) -> OutputStatistics

Trait Implementations§

§

impl<P: Processor> Drop for PreparedOutput<P>

§

fn drop(&mut self)

Executes the destructor for this type. Read more
§

fn pin_drop(self: Pin<&mut Self>)

Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<P> Freeze for PreparedOutput<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for PreparedOutput<P>
where P: RefUnwindSafe,

§

impl<P> Send for PreparedOutput<P>
where P: Send,

§

impl<P> Sync for PreparedOutput<P>
where P: Sync,

§

impl<P> Unpin for PreparedOutput<P>
where P: Unpin,

§

impl<P> UnsafeUnpin for PreparedOutput<P>
where P: UnsafeUnpin,

§

impl<P> UnwindSafe for PreparedOutput<P>
where P: UnwindSafe,

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> AutoreleaseSafe for T
where T: ?Sized,

§

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<S, T> Duplex<S> for Twhere T: FromSample<S> + ToSample<S>,

§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

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<F, T> IntoSample<T> for Fwhere T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<T, U> ToSample<U> for Twhere U: FromSample<T>,

§

fn to_sample_(self) -> U

§

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.