Struct fxbox_taxonomy::selector::NodeSelector
[−]
[src]
pub struct NodeSelector { pub id: Exactly<Id<NodeId>>, pub tags: Vec<String>, pub inputs: Vec<GetSelector>, pub outputs: Vec<SetSelector>, // some fields omitted }
A selector for one or more nodes.
Example
use fxbox_taxonomy::selector::*; use fxbox_taxonomy::devices::*; let selector = NodeSelector::new() .with_tags(vec!["entrance".to_owned()]) .with_inputs(vec![GetSelector::new() /* can be more restrictive */]);
Fields
id | If |
tags | Restrict results to nodes that have all the tags in |
inputs | Restrict results to nodes that have all the inputs in |
outputs | Restrict results to nodes that have all the outputs in |
Methods
impl NodeSelector
fn new() -> Self
Create a new selector that accepts all nodes.
fn with_id(self, id: Id<NodeId>) -> Self
Selector for a node with a specific id.
fn with_tags(self, tags: Vec<String>) -> Self
Restrict results to nodes that have all the tags in tags
.
fn with_inputs(self, inputs: Vec<GetSelector>) -> Self
Restrict results to nodes that have all the inputs in inputs
.
fn with_outputs(self, outputs: Vec<SetSelector>) -> Self
Restrict results to nodes that have all the outputs in outputs
.
fn and(self, other: NodeSelector) -> Self
Restrict results to nodes that are accepted by two selector.