Skip to main content

Patch

Struct Patch 

Source
pub struct Patch<'run, 'node, M, S, const PORTS: usize, P: ?Sized = dyn Process<M, S> + 'node> { /* private fields */ }
Expand description

A decoded schedule bound to the stateful objects it will render.

Implementations§

Source§

impl<'run, M, S, const PORTS: usize, P: Process<M, S> + ?Sized> Patch<'run, '_, M, S, PORTS, P>

Source

pub fn replace<const OPS: usize>( &mut self, program: &'run Program<'_, OPS, PORTS>, available_buses: usize, ) -> Result<(), Error>

Switch schedules between blocks, retaining every object’s state.

§Errors

If the program needs more than available_buses or the object layouts are incompatible, the current schedule remains active.

Source

pub fn render<const FRAMES: usize>( &mut self, dsp: &mut impl Dsp<S>, buffers: &mut [[S; FRAMES]], events: &[&[Event<M>]], emit: impl FnMut(u8, Event<M>) -> Result<(), Event<M>>, ) -> Result<(), Error>

Render one block into caller-owned mono buses. The host chooses which bus to send to each physical output. events[i] belongs to object i; omitted trailing lists are empty. The emit sink receives the emitting object’s index and its unmodified local outlet event. The host bounds the number of input events per block and the work in its event sink to fit its audio deadline.

§Errors

Invalid events, events addressed to inactive objects, and insufficient buffers are rejected before processing any object or writing any output.

Trait Implementations§

Source§

impl<M, S, const PORTS: usize, P: ?Sized> Debug for Patch<'_, '_, M, S, PORTS, P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'run, 'node, M, S, const PORTS: usize, P = dyn Process<M, S> + 'node> !UnwindSafe for Patch<'run, 'node, M, S, PORTS, P>

§

impl<'run, 'node, M, S, const PORTS: usize, P> Forget for Patch<'run, 'node, M, S, PORTS, P>
where P: ?Sized,

§

impl<'run, 'node, M, S, const PORTS: usize, P> Freeze for Patch<'run, 'node, M, S, PORTS, P>
where &'run [Op<'run>]: Freeze, &'run mut [&'node mut P]: Freeze, PhantomData<fn(M, S)>: Freeze, P: ?Sized,

§

impl<'run, 'node, M, S, const PORTS: usize, P> Move for Patch<'run, 'node, M, S, PORTS, P>
where P: ?Sized,

§

impl<'run, 'node, M, S, const PORTS: usize, P> RefUnwindSafe for Patch<'run, 'node, M, S, PORTS, P>
where P: RefUnwindSafe + ?Sized,

§

impl<'run, 'node, M, S, const PORTS: usize, P> Send for Patch<'run, 'node, M, S, PORTS, P>
where P: Send + ?Sized, &'run [Op<'run>]: Send,

§

impl<'run, 'node, M, S, const PORTS: usize, P> Sync for Patch<'run, 'node, M, S, PORTS, P>
where P: Sync + ?Sized,

§

impl<'run, 'node, M, S, const PORTS: usize, P> Unpin for Patch<'run, 'node, M, S, PORTS, P>
where &'run [Op<'run>]: Unpin, &'run mut [&'node mut P]: Unpin, P: ?Sized,

§

impl<'run, 'node, M, S, const PORTS: usize, P> UnsafeUnpin for Patch<'run, 'node, M, S, PORTS, P>
where &'run [Op<'run>]: UnsafeUnpin, &'run mut [&'node mut P]: UnsafeUnpin, PhantomData<fn(M, S)>: UnsafeUnpin, P: ?Sized,

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

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> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.