Skip to main content

DriverResult

Struct DriverResult 

Source
pub struct DriverResult<P>
where P: PluginExport,
{ pub output: Vec<Vec<f32>>, pub sample_rate: f64, pub block_size: usize, pub total_frames: usize, pub meters: MeterReadings, pub output_events: Vec<Event>, pub block_snapshots: Vec<Vec<(u32, f64)>>, pub plugin: P, }
Expand description

Captured audio + metadata + plugin instance from a PluginDriver run.

Holds the post-run plugin instance (plugin: P) so post-run assertions can read params or custom state directly. As a side effect, DriverResult: !Send whenever P: !Send - which is true for plugins built via truce::plugin! (the generated Plugin alias is unsafe impl Send only conditionally on its inner Params type). Test code rarely cares; document if you hit it.

Fields§

§output: Vec<Vec<f32>>

Channel-major output: output[ch][frame]. Empty when CaptureSpec::audio == false.

§sample_rate: f64§block_size: usize§total_frames: usize§meters: MeterReadings

Final-or-per-block meter readings.

§output_events: Vec<Event>

Output events emitted by the plugin. Offsets are absolute (cumulative across blocks). Empty unless CaptureSpec::output_events.

§block_snapshots: Vec<Vec<(u32, f64)>>

Per-block param snapshots (one Vec per block), each entry (param_id, plain_value). Empty unless CaptureSpec::block_snapshots.

§plugin: P

Post-run plugin instance. Read params or custom state from here when writing assertions over the final state.

Auto Trait Implementations§

§

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

§

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

§

impl<P> Send for DriverResult<P>

§

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

§

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

§

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

§

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

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.