Struct lilv::plugin::Plugins

source ·
pub struct Plugins { /* private fields */ }
Expand description

A collection of plugins.

Implementations§

source§

impl Plugins

source

pub fn iter(&self) -> impl '_ + Iterator<Item = Plugin>

An iterable over all the plugins in the world.

Examples found in repository?
examples/lv2ls.rs (line 19)
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
fn main() {
    let world = World::new();
    world.load_all();

    let show_names = false;

    let print = |plugin: Plugin| {
        if show_names {
            String::from(plugin.name().as_str().unwrap())
        } else {
            String::from(plugin.uri().as_uri().unwrap())
        }
    };

    let plugins = world
        .plugins()
        .iter()
        .filter(Plugin::verify)
        .map(print)
        .collect::<Vec<_>>();

    debug_assert_eq!(world.plugins().count(), plugins.len());

    for uri in plugins {
        println!("{}", uri);
    }
}
More examples
Hide additional examples
examples/lv2info.rs (line 249)
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
fn main() {
    let w = World::new();
    w.load_all();

    let nodes = Nodes {
        control_class: w.new_uri("http://lv2plug.in/ns/lv2core#ControlPort"),
        event_class: w.new_uri("http://lv2plug.in/ns/ext/atom#AtomPort"),
        group_pred: w.new_uri("http://lv2plug.in/ns/ext/port-groups#group"),
        label_pred: w.new_uri("http://www.w3.org/2000/01/rdf-schema#label"),
        preset_class: w.new_uri("http://lv2plug.in/ns/ext/presets#Preset"),
        designation_pred: w.new_uri("http://lv2plug.in/ns/lv2core#designation"),
        supports_event_pred: w.new_uri("http://lv2plug.in/ns/ext/atom#supportsEvent"),
    };

    for p in w.plugins().iter().filter(Plugin::verify) {
        print_plugin(&w, &p, &nodes);
    }
}
source

pub fn plugin(&self, uri: &Node) -> Option<Plugin>

Get a plugin by its unique identifier.

source

pub fn count(&self) -> usize

The number of plugins loaded.

Examples found in repository?
examples/lv2ls.rs (line 24)
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
fn main() {
    let world = World::new();
    world.load_all();

    let show_names = false;

    let print = |plugin: Plugin| {
        if show_names {
            String::from(plugin.name().as_str().unwrap())
        } else {
            String::from(plugin.uri().as_uri().unwrap())
        }
    };

    let plugins = world
        .plugins()
        .iter()
        .filter(Plugin::verify)
        .map(print)
        .collect::<Vec<_>>();

    debug_assert_eq!(world.plugins().count(), plugins.len());

    for uri in plugins {
        println!("{}", uri);
    }
}

Trait Implementations§

source§

impl IntoIterator for Plugins

§

type Item = Plugin

The type of the elements being iterated over.
§

type IntoIter = PluginsIter<Plugins>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Plugins

§

impl !Send for Plugins

§

impl !Sync for Plugins

§

impl Unpin for Plugins

§

impl !UnwindSafe for Plugins

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.