Skip to main content

ChannelPair

Enum ChannelPair 

Source
pub enum ChannelPair<'a, S> {
    InputOnly(&'a [S]),
    OutputOnly(&'a mut [S]),
    InputOutput(&'a [S], &'a mut [S]),
    InPlace(&'a mut [S]),
}
Expand description

A pair of input and output channel buffers.

Because port and channel layouts may differ between inputs and outputs, a ChannelPair may actually contain only an input or an output instead of both.

This enum also allows to check for the fairly common case where Host may re-use the same buffer for both the input and output, and expect the plugin to do in-place processing.

Variants§

§

InputOnly(&'a [S])

There is only an input channel present, there was no matching output.

§

OutputOnly(&'a mut [S])

There is only an output channel present, there was no matching input.

§

InputOutput(&'a [S], &'a mut [S])

Both the input and output channels are present, and available separately.

§

InPlace(&'a mut [S])

Both the input and output channels are present, but they actually share the same buffer.

In this case, the slice is already filled with the input channel’s data, and the host considers the contents of this buffer after processing to be the output channel’s data.

Implementations§

Source§

impl<'a, S> ChannelPair<'a, S>

Source

pub fn input(&'a self) -> Option<&'a [S]>

Attempts to retrieve the input channel’s buffer data, if the input channel is present.

Source

pub fn output(&'a self) -> Option<&'a [S]>

Attempts to retrieve a read-only reference to the output channel’s buffer data, if the output channel is present.

Source

pub fn output_mut(&'a mut self) -> Option<&'a mut [S]>

Attempts to retrieve a read-write reference to the output channel’s buffer data, if the output channel is present.

Auto Trait Implementations§

§

impl<'a, S> !UnwindSafe for ChannelPair<'a, S>

§

impl<'a, S> Freeze for ChannelPair<'a, S>
where &'a [S]: Freeze, &'a mut [S]: Freeze,

§

impl<'a, S> RefUnwindSafe for ChannelPair<'a, S>
where &'a [S]: RefUnwindSafe, &'a mut [S]: RefUnwindSafe,

§

impl<'a, S> Send for ChannelPair<'a, S>
where &'a [S]: Send, &'a mut [S]: Send,

§

impl<'a, S> Sync for ChannelPair<'a, S>
where &'a [S]: Sync, &'a mut [S]: Sync,

§

impl<'a, S> Unpin for ChannelPair<'a, S>
where &'a [S]: Unpin, &'a mut [S]: Unpin,

§

impl<'a, S> UnsafeUnpin for ChannelPair<'a, S>
where &'a [S]: UnsafeUnpin, &'a mut [S]: 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.