Skip to main content

InputEventBuffer

Trait InputEventBuffer 

Source
pub trait InputEventBuffer: Sized {
    // Required methods
    fn len(&self) -> u32;
    fn get(&self, index: u32) -> Option<&UnknownEvent>;
}
Expand description

A trait for all types which can act as an ordered, indexed list of UnknownEvents.

This is the backing implementation of an InputEvents, which is how input events are shared from the CLAP host to the plugin.

Note that events are indexed using u32 instead of the standard usize, to match the CLAP specification.

Required Methods§

Source

fn len(&self) -> u32

Returns the number of events in this list.

Source

fn get(&self, index: u32) -> Option<&UnknownEvent>

Returns the event at the given index.

If index is out of bounds, then this must return None instead.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl InputEventBuffer for &[&UnknownEvent]

Source§

fn len(&self) -> u32

Source§

fn get(&self, index: u32) -> Option<&UnknownEvent>

Source§

impl InputEventBuffer for ()

Source§

fn len(&self) -> u32

Source§

fn get(&self, _index: u32) -> Option<&UnknownEvent>

Source§

impl InputEventBuffer for Vec<&UnknownEvent>

Source§

fn len(&self) -> u32

Source§

fn get(&self, index: u32) -> Option<&UnknownEvent>

Source§

impl<T, U> InputEventBuffer for (&T, &U)

Source§

fn len(&self) -> u32

Source§

fn get(&self, index: u32) -> Option<&UnknownEvent>

Source§

impl<T, const N: usize> InputEventBuffer for [T; N]
where T: Event,

Source§

fn len(&self) -> u32

Source§

fn get(&self, index: u32) -> Option<&UnknownEvent>

Source§

impl<T> InputEventBuffer for &[T]
where T: Event,

Source§

fn len(&self) -> u32

Source§

fn get(&self, index: u32) -> Option<&UnknownEvent>

Source§

impl<T> InputEventBuffer for Option<T>

Source§

fn len(&self) -> u32

Source§

fn get(&self, index: u32) -> Option<&UnknownEvent>

Source§

impl<T> InputEventBuffer for Vec<T>
where T: Event,

Source§

fn len(&self) -> u32

Source§

fn get(&self, index: u32) -> Option<&UnknownEvent>

Source§

impl<const N: usize> InputEventBuffer for [&UnknownEvent; N]

Source§

fn len(&self) -> u32

Source§

fn get(&self, index: u32) -> Option<&UnknownEvent>

Implementors§