[][src]Trait lv2::prelude::FeatureCollection

pub trait FeatureCollection<'a>: 'a {
    fn from_cache(
        cache: &mut FeatureCache<'a>,
        class: ThreadingClass
    ) -> Result<Self, MissingFeatureError>; }

Convenience trait for feature collections.

The feature cache is only for temporary use; Once a feature is retrieved, it is removed from the cache. Therefore you need a way to properly store features.

You can simply create a struct with features as it's fields and derive FeatureCollection for it. A procedural macro will then create a method that populates the struct from the cache, or returns None if one of the required features is not in the cache.

An example using the few built-in features:

use lv2_core::plugin::*;
use lv2_core::feature::*;

#[derive(FeatureCollection)]
struct MyCollection {
    live: IsLive,
    hardrt: Option<HardRTCapable>,
}

Required methods

fn from_cache(
    cache: &mut FeatureCache<'a>,
    class: ThreadingClass
) -> Result<Self, MissingFeatureError>

Populate a collection with features from the cache for the given threading class.

Loading content...

Implementations on Foreign Types

impl<'a> FeatureCollection<'a> for ()[src]

Loading content...

Implementors

impl<'a> FeatureCollection<'a> for FeatureCache<'a>[src]

Loading content...