pub struct UI { /* private fields */ }Implementations§
Source§impl UI
impl UI
Sourcepub fn uri(&self) -> Node
pub fn uri(&self) -> Node
Examples found in repository?
examples/lv2info.rs (line 143)
101fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
102 println!("{}\n", p.uri().as_uri().unwrap());
103 println!("\tName: {}", p.name().as_str().unwrap());
104 println!(
105 "\tClass: {}",
106 p.class().label().as_str().unwrap()
107 );
108
109 if let Some(val) = p.author_name() {
110 println!("\tAuthor: {}", val.as_str().unwrap());
111 }
112
113 if let Some(val) = p.author_email() {
114 println!("\tAuthor Email: {}", val.as_str().unwrap());
115 }
116
117 if let Some(val) = p.author_homepage() {
118 println!("\tAuthor Homepage: {}", val.as_uri().unwrap());
119 }
120
121 if let Some(latency_port) = p.latency_port_index() {
122 println!(
123 "\tHas latency: yes, reported by port {}",
124 latency_port
125 );
126 } else {
127 println!("\tHas latency: no");
128 }
129
130 println!("\tBundle: {}", p.bundle_uri().as_uri().unwrap());
131 println!(
132 "\tBinary: {}",
133 p.library_uri().map_or("<none>".to_string(), |node| node
134 .as_uri()
135 .unwrap()
136 .to_string())
137 );
138
139 if let Some(uis) = p.uis() {
140 println!("\tUIs:");
141
142 for ui in uis {
143 println!("\t\t{}", ui.uri().as_uri().unwrap());
144
145 for tyep in ui.classes() {
146 println!("\t\t\tClass: {}", tyep.as_uri().unwrap());
147 }
148
149 println!(
150 "\t\t\tBinary: {}",
151 ui.binary_uri().unwrap().as_uri().unwrap()
152 );
153 println!(
154 "\t\t\tBundle: {}",
155 ui.bundle_uri().unwrap().as_uri().unwrap()
156 );
157 }
158 }
159
160 print!("\tData URIs: ");
161
162 for (i, uri) in p.data_uris().iter().enumerate() {
163 if i != 0 {
164 print!("\n\t ");
165 }
166
167 print!("{}", uri.as_uri().unwrap());
168 }
169
170 println!();
171
172 let features = p.required_features();
173 print!("\tRequired Features: ");
174
175 for (i, feature) in features.iter().enumerate() {
176 if i != 0 {
177 print!("\n\t ");
178 }
179 print!("{}", feature.as_uri().unwrap());
180 }
181 println!();
182
183 let features = p.optional_features();
184 print!("\tOptional Features: ");
185
186 for (i, feature) in features.iter().enumerate() {
187 if i != 0 {
188 print!("\n\t ");
189 }
190 print!("{}", feature.as_uri().unwrap());
191 }
192 println!();
193
194 if let Some(data) = p.extension_data() {
195 print!("\tExtension Data: ");
196
197 for (i, d) in data.iter().enumerate() {
198 if i != 0 {
199 print!("\n\t ");
200 }
201 print!("{}", d.as_uri().unwrap());
202 }
203 println!();
204 }
205
206 if let Some(presets) = p.related(Some(&nodes.preset_class)) {
207 if presets.count() != 0 {
208 println!("\tPresets: ");
209
210 for preset in presets {
211 world.load_resource(&preset).unwrap();
212
213 let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
214 if titles.count() > 0 {
215 if let Some(title) = titles.iter().next() {
216 println!("\t {}", title.as_str().unwrap());
217 } else {
218 println!("\t <{}>", preset.as_uri().unwrap());
219 }
220 } else {
221 println!("\t <{}>", preset.as_uri().unwrap());
222 }
223 }
224 }
225 }
226
227 let num_ports = p.ports_count();
228 let port_ranges = p.port_ranges_float();
229 assert_eq!(num_ports, port_ranges.len());
230 for (i, pr) in port_ranges.iter().enumerate() {
231 print_port(p, i, pr, nodes);
232 }
233}Sourcepub fn classes(&self) -> Nodes
pub fn classes(&self) -> Nodes
Get the types (URIs of RDF classes) of a Plugin UI.
Examples found in repository?
examples/lv2info.rs (line 145)
101fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
102 println!("{}\n", p.uri().as_uri().unwrap());
103 println!("\tName: {}", p.name().as_str().unwrap());
104 println!(
105 "\tClass: {}",
106 p.class().label().as_str().unwrap()
107 );
108
109 if let Some(val) = p.author_name() {
110 println!("\tAuthor: {}", val.as_str().unwrap());
111 }
112
113 if let Some(val) = p.author_email() {
114 println!("\tAuthor Email: {}", val.as_str().unwrap());
115 }
116
117 if let Some(val) = p.author_homepage() {
118 println!("\tAuthor Homepage: {}", val.as_uri().unwrap());
119 }
120
121 if let Some(latency_port) = p.latency_port_index() {
122 println!(
123 "\tHas latency: yes, reported by port {}",
124 latency_port
125 );
126 } else {
127 println!("\tHas latency: no");
128 }
129
130 println!("\tBundle: {}", p.bundle_uri().as_uri().unwrap());
131 println!(
132 "\tBinary: {}",
133 p.library_uri().map_or("<none>".to_string(), |node| node
134 .as_uri()
135 .unwrap()
136 .to_string())
137 );
138
139 if let Some(uis) = p.uis() {
140 println!("\tUIs:");
141
142 for ui in uis {
143 println!("\t\t{}", ui.uri().as_uri().unwrap());
144
145 for tyep in ui.classes() {
146 println!("\t\t\tClass: {}", tyep.as_uri().unwrap());
147 }
148
149 println!(
150 "\t\t\tBinary: {}",
151 ui.binary_uri().unwrap().as_uri().unwrap()
152 );
153 println!(
154 "\t\t\tBundle: {}",
155 ui.bundle_uri().unwrap().as_uri().unwrap()
156 );
157 }
158 }
159
160 print!("\tData URIs: ");
161
162 for (i, uri) in p.data_uris().iter().enumerate() {
163 if i != 0 {
164 print!("\n\t ");
165 }
166
167 print!("{}", uri.as_uri().unwrap());
168 }
169
170 println!();
171
172 let features = p.required_features();
173 print!("\tRequired Features: ");
174
175 for (i, feature) in features.iter().enumerate() {
176 if i != 0 {
177 print!("\n\t ");
178 }
179 print!("{}", feature.as_uri().unwrap());
180 }
181 println!();
182
183 let features = p.optional_features();
184 print!("\tOptional Features: ");
185
186 for (i, feature) in features.iter().enumerate() {
187 if i != 0 {
188 print!("\n\t ");
189 }
190 print!("{}", feature.as_uri().unwrap());
191 }
192 println!();
193
194 if let Some(data) = p.extension_data() {
195 print!("\tExtension Data: ");
196
197 for (i, d) in data.iter().enumerate() {
198 if i != 0 {
199 print!("\n\t ");
200 }
201 print!("{}", d.as_uri().unwrap());
202 }
203 println!();
204 }
205
206 if let Some(presets) = p.related(Some(&nodes.preset_class)) {
207 if presets.count() != 0 {
208 println!("\tPresets: ");
209
210 for preset in presets {
211 world.load_resource(&preset).unwrap();
212
213 let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
214 if titles.count() > 0 {
215 if let Some(title) = titles.iter().next() {
216 println!("\t {}", title.as_str().unwrap());
217 } else {
218 println!("\t <{}>", preset.as_uri().unwrap());
219 }
220 } else {
221 println!("\t <{}>", preset.as_uri().unwrap());
222 }
223 }
224 }
225 }
226
227 let num_ports = p.ports_count();
228 let port_ranges = p.port_ranges_float();
229 assert_eq!(num_ports, port_ranges.len());
230 for (i, pr) in port_ranges.iter().enumerate() {
231 print_port(p, i, pr, nodes);
232 }
233}pub fn is_supported<S>(
&self,
container_type: &Node,
ui_type: Option<&mut Option<Node>>,
) -> UISupportQualitywhere
S: UISupport,
Sourcepub fn bundle_uri(&self) -> Option<Node>
pub fn bundle_uri(&self) -> Option<Node>
Examples found in repository?
examples/lv2info.rs (line 155)
101fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
102 println!("{}\n", p.uri().as_uri().unwrap());
103 println!("\tName: {}", p.name().as_str().unwrap());
104 println!(
105 "\tClass: {}",
106 p.class().label().as_str().unwrap()
107 );
108
109 if let Some(val) = p.author_name() {
110 println!("\tAuthor: {}", val.as_str().unwrap());
111 }
112
113 if let Some(val) = p.author_email() {
114 println!("\tAuthor Email: {}", val.as_str().unwrap());
115 }
116
117 if let Some(val) = p.author_homepage() {
118 println!("\tAuthor Homepage: {}", val.as_uri().unwrap());
119 }
120
121 if let Some(latency_port) = p.latency_port_index() {
122 println!(
123 "\tHas latency: yes, reported by port {}",
124 latency_port
125 );
126 } else {
127 println!("\tHas latency: no");
128 }
129
130 println!("\tBundle: {}", p.bundle_uri().as_uri().unwrap());
131 println!(
132 "\tBinary: {}",
133 p.library_uri().map_or("<none>".to_string(), |node| node
134 .as_uri()
135 .unwrap()
136 .to_string())
137 );
138
139 if let Some(uis) = p.uis() {
140 println!("\tUIs:");
141
142 for ui in uis {
143 println!("\t\t{}", ui.uri().as_uri().unwrap());
144
145 for tyep in ui.classes() {
146 println!("\t\t\tClass: {}", tyep.as_uri().unwrap());
147 }
148
149 println!(
150 "\t\t\tBinary: {}",
151 ui.binary_uri().unwrap().as_uri().unwrap()
152 );
153 println!(
154 "\t\t\tBundle: {}",
155 ui.bundle_uri().unwrap().as_uri().unwrap()
156 );
157 }
158 }
159
160 print!("\tData URIs: ");
161
162 for (i, uri) in p.data_uris().iter().enumerate() {
163 if i != 0 {
164 print!("\n\t ");
165 }
166
167 print!("{}", uri.as_uri().unwrap());
168 }
169
170 println!();
171
172 let features = p.required_features();
173 print!("\tRequired Features: ");
174
175 for (i, feature) in features.iter().enumerate() {
176 if i != 0 {
177 print!("\n\t ");
178 }
179 print!("{}", feature.as_uri().unwrap());
180 }
181 println!();
182
183 let features = p.optional_features();
184 print!("\tOptional Features: ");
185
186 for (i, feature) in features.iter().enumerate() {
187 if i != 0 {
188 print!("\n\t ");
189 }
190 print!("{}", feature.as_uri().unwrap());
191 }
192 println!();
193
194 if let Some(data) = p.extension_data() {
195 print!("\tExtension Data: ");
196
197 for (i, d) in data.iter().enumerate() {
198 if i != 0 {
199 print!("\n\t ");
200 }
201 print!("{}", d.as_uri().unwrap());
202 }
203 println!();
204 }
205
206 if let Some(presets) = p.related(Some(&nodes.preset_class)) {
207 if presets.count() != 0 {
208 println!("\tPresets: ");
209
210 for preset in presets {
211 world.load_resource(&preset).unwrap();
212
213 let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
214 if titles.count() > 0 {
215 if let Some(title) = titles.iter().next() {
216 println!("\t {}", title.as_str().unwrap());
217 } else {
218 println!("\t <{}>", preset.as_uri().unwrap());
219 }
220 } else {
221 println!("\t <{}>", preset.as_uri().unwrap());
222 }
223 }
224 }
225 }
226
227 let num_ports = p.ports_count();
228 let port_ranges = p.port_ranges_float();
229 assert_eq!(num_ports, port_ranges.len());
230 for (i, pr) in port_ranges.iter().enumerate() {
231 print_port(p, i, pr, nodes);
232 }
233}Sourcepub fn binary_uri(&self) -> Option<Node>
pub fn binary_uri(&self) -> Option<Node>
Get the uri for the binary.
Examples found in repository?
examples/lv2info.rs (line 151)
101fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
102 println!("{}\n", p.uri().as_uri().unwrap());
103 println!("\tName: {}", p.name().as_str().unwrap());
104 println!(
105 "\tClass: {}",
106 p.class().label().as_str().unwrap()
107 );
108
109 if let Some(val) = p.author_name() {
110 println!("\tAuthor: {}", val.as_str().unwrap());
111 }
112
113 if let Some(val) = p.author_email() {
114 println!("\tAuthor Email: {}", val.as_str().unwrap());
115 }
116
117 if let Some(val) = p.author_homepage() {
118 println!("\tAuthor Homepage: {}", val.as_uri().unwrap());
119 }
120
121 if let Some(latency_port) = p.latency_port_index() {
122 println!(
123 "\tHas latency: yes, reported by port {}",
124 latency_port
125 );
126 } else {
127 println!("\tHas latency: no");
128 }
129
130 println!("\tBundle: {}", p.bundle_uri().as_uri().unwrap());
131 println!(
132 "\tBinary: {}",
133 p.library_uri().map_or("<none>".to_string(), |node| node
134 .as_uri()
135 .unwrap()
136 .to_string())
137 );
138
139 if let Some(uis) = p.uis() {
140 println!("\tUIs:");
141
142 for ui in uis {
143 println!("\t\t{}", ui.uri().as_uri().unwrap());
144
145 for tyep in ui.classes() {
146 println!("\t\t\tClass: {}", tyep.as_uri().unwrap());
147 }
148
149 println!(
150 "\t\t\tBinary: {}",
151 ui.binary_uri().unwrap().as_uri().unwrap()
152 );
153 println!(
154 "\t\t\tBundle: {}",
155 ui.bundle_uri().unwrap().as_uri().unwrap()
156 );
157 }
158 }
159
160 print!("\tData URIs: ");
161
162 for (i, uri) in p.data_uris().iter().enumerate() {
163 if i != 0 {
164 print!("\n\t ");
165 }
166
167 print!("{}", uri.as_uri().unwrap());
168 }
169
170 println!();
171
172 let features = p.required_features();
173 print!("\tRequired Features: ");
174
175 for (i, feature) in features.iter().enumerate() {
176 if i != 0 {
177 print!("\n\t ");
178 }
179 print!("{}", feature.as_uri().unwrap());
180 }
181 println!();
182
183 let features = p.optional_features();
184 print!("\tOptional Features: ");
185
186 for (i, feature) in features.iter().enumerate() {
187 if i != 0 {
188 print!("\n\t ");
189 }
190 print!("{}", feature.as_uri().unwrap());
191 }
192 println!();
193
194 if let Some(data) = p.extension_data() {
195 print!("\tExtension Data: ");
196
197 for (i, d) in data.iter().enumerate() {
198 if i != 0 {
199 print!("\n\t ");
200 }
201 print!("{}", d.as_uri().unwrap());
202 }
203 println!();
204 }
205
206 if let Some(presets) = p.related(Some(&nodes.preset_class)) {
207 if presets.count() != 0 {
208 println!("\tPresets: ");
209
210 for preset in presets {
211 world.load_resource(&preset).unwrap();
212
213 let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
214 if titles.count() > 0 {
215 if let Some(title) = titles.iter().next() {
216 println!("\t {}", title.as_str().unwrap());
217 } else {
218 println!("\t <{}>", preset.as_uri().unwrap());
219 }
220 } else {
221 println!("\t <{}>", preset.as_uri().unwrap());
222 }
223 }
224 }
225 }
226
227 let num_ports = p.ports_count();
228 let port_ranges = p.port_ranges_float();
229 assert_eq!(num_ports, port_ranges.len());
230 for (i, pr) in port_ranges.iter().enumerate() {
231 print_port(p, i, pr, nodes);
232 }
233}Auto Trait Implementations§
impl Freeze for UI
impl !RefUnwindSafe for UI
impl !Send for UI
impl !Sync for UI
impl Unpin for UI
impl !UnwindSafe for UI
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