[][src]Trait lv2_core::port::PortType

pub trait PortType {
    type InputPortType: Sized;
    type OutputPortType: Sized;
    unsafe fn input_from_raw(
        pointer: NonNull<c_void>,
        sample_count: u32
    ) -> Self::InputPortType;
unsafe fn output_from_raw(
        pointer: NonNull<c_void>,
        sample_count: u32
    ) -> Self::OutputPortType; }

Generalization of port types.

A port can read input or create a pointer to the output, but the exact type of input/output (pointer) depends on the type of port. This trait generalizes these types and behaviour.

Associated Types

type InputPortType: Sized

The type of input read by the port.

type OutputPortType: Sized

The type of output reference created by the port.

Loading content...

Required methods

unsafe fn input_from_raw(
    pointer: NonNull<c_void>,
    sample_count: u32
) -> Self::InputPortType

Read data from the pointer or create a reference to the input.

If the resulting data is a slice, sample_count is the length of the slice.

Safety

This method is unsafe because one needs to de-reference a raw pointer to implement this method.

unsafe fn output_from_raw(
    pointer: NonNull<c_void>,
    sample_count: u32
) -> Self::OutputPortType

Create a reference to the data where output should be written to.

If the data is a slice, sample_count is the length of the slice.

Safety

This method is unsafe because one needs to de-reference a raw pointer to implement this method.

Loading content...

Implementors

impl PortType for Audio[src]

type InputPortType = &'static [f32]

type OutputPortType = &'static mut [f32]

impl PortType for CV[src]

type InputPortType = &'static [f32]

type OutputPortType = &'static mut [f32]

impl PortType for Control[src]

type InputPortType = f32

type OutputPortType = &'static mut f32

Loading content...