pub struct Plugins { /* private fields */ }Expand description
A collection of plugins.
Implementations§
source§impl Plugins
impl Plugins
sourcepub fn iter(&self) -> impl '_ + Iterator<Item = Plugin>
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
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);
}
}sourcepub fn count(&self) -> usize
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§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more