Struct PortConnection

Source
pub struct PortConnection<'a> {
    pub port: Port,
    pub data: PortData<'a>,
}
Expand description

Represents a connection between a port and the data attached to the port by the plugin host.

Fields§

§port: Port

The port which the data is connected to.

§data: PortData<'a>

The data connected to the port. It’s usually simpler to use the various unwrap_* functions than to interface with this directly.

Implementations§

Source§

impl<'a> PortConnection<'a>

Source

pub fn unwrap_audio(&'a self) -> &'a [Data]

Returns a slice pointing to the internal data of an audio input port. Panics if this port is not an AudioIn port.

Source

pub fn unwrap_audio_mut(&'a self) -> RefMut<'a, &'a mut [Data]>

Returns a mutable slice pointing to the internal data of an audio output port. Panics if this port is not an AudioOut port.

Source

pub fn unwrap_control(&'a self) -> &'a Data

Returns a refrence to the internal data of an control input port. Panics if this port is not an ControlIn port.

Source

pub fn unwrap_control_mut(&'a self) -> RefMut<'a, &'a mut Data>

Returns a mutable refrence to the internal data of an audio output port. Panics if this port is not an ControlOut port.

Auto Trait Implementations§

§

impl<'a> !Freeze for PortConnection<'a>

§

impl<'a> !RefUnwindSafe for PortConnection<'a>

§

impl<'a> Send for PortConnection<'a>

§

impl<'a> Sync for PortConnection<'a>

§

impl<'a> Unpin for PortConnection<'a>

§

impl<'a> !UnwindSafe for PortConnection<'a>

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.