Skip to main content

ProcessContext

Struct ProcessContext 

Source
pub struct ProcessContext<'call, 'output, M = (), S = f32> {
    pub frames: usize,
    pub inputs: &'call [&'call [S]],
    pub outputs: &'call mut [&'output mut [S]],
    pub events: &'call [Event<M>],
    pub emit: &'call mut dyn FnMut(Event<M>) -> Result<(), Event<M>>,
}
Expand description

Borrowed signals and messages for one call. The output table can be reborrowed independently of its sample storage.

Fields§

§frames: usize

Number of frames in every signal buffer. A zero-frame call delivers messages at offset zero without advancing audio time.

§inputs: &'call [&'call [S]]

One shared buffer per signal inlet, in inlet order. For inlets [Message, Signal], buffer zero belongs to inlet one.

§outputs: &'call mut [&'output mut [S]]

One exclusive buffer per signal outlet, in outlet order. The processor overwrites every frame. An additive renderer clears its output first.

§events: &'call [Event<M>]

Messages in nondecreasing frame order. Apply ties in slice order. In a nonempty block, offsets are less than frames. An event at the end belongs to the next block.

§emit: &'call mut dyn FnMut(Event<M>) -> Result<(), Event<M>>

Emit in frame order on a message outlet. The host maps the outlet to downstream inlets and preserves the frame offset and emission order. Return the original event if the host cannot accept it.

Auto Trait Implementations§

§

impl<'call, 'output, M = (), S = f32> !RefUnwindSafe for ProcessContext<'call, 'output, M, S>

§

impl<'call, 'output, M = (), S = f32> !Send for ProcessContext<'call, 'output, M, S>

§

impl<'call, 'output, M = (), S = f32> !Sync for ProcessContext<'call, 'output, M, S>

§

impl<'call, 'output, M = (), S = f32> !UnwindSafe for ProcessContext<'call, 'output, M, S>

§

impl<'call, 'output, M, S> Forget for ProcessContext<'call, 'output, M, S>

§

impl<'call, 'output, M, S> Freeze for ProcessContext<'call, 'output, M, S>
where &'call [&'call [S]]: Freeze, &'call mut [&'output mut [S]]: Freeze, &'call [Event<M>]: Freeze, &'call mut dyn FnMut(Event<M>) -> Result<(), Event<M>>: Freeze,

§

impl<'call, 'output, M, S> Move for ProcessContext<'call, 'output, M, S>

§

impl<'call, 'output, M, S> Unpin for ProcessContext<'call, 'output, M, S>
where &'call [&'call [S]]: Unpin, &'call mut [&'output mut [S]]: Unpin, &'call [Event<M>]: Unpin, &'call mut dyn FnMut(Event<M>) -> Result<(), Event<M>>: Unpin,

§

impl<'call, 'output, M, S> UnsafeUnpin for ProcessContext<'call, 'output, M, S>
where &'call [&'call [S]]: UnsafeUnpin, &'call mut [&'output mut [S]]: UnsafeUnpin, &'call [Event<M>]: UnsafeUnpin, &'call mut dyn FnMut(Event<M>) -> Result<(), Event<M>>: UnsafeUnpin,

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 = !

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.