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 Exactly(id), return only the node with the corresponding id.

tags

Restrict results to nodes that have all the tags in tags.

inputs

Restrict results to nodes that have all the inputs in inputs.

outputs

Restrict results to nodes that have all the outputs in outputs.

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.

Trait Implementations

impl Deserialize for NodeSelector

fn deserialize<__D>(deserializer: &mut __D) -> Result<NodeSelector, __D::Error> where __D: Deserializer

impl Serialize for NodeSelector

fn serialize<__S>(&self, serializer: &mut __S) -> Result<(), __S::Error> where __S: Serializer

Derived Implementations

impl Default for NodeSelector

fn default() -> NodeSelector

impl Debug for NodeSelector

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Clone for NodeSelector

fn clone(&self) -> NodeSelector

1.0.0fn clone_from(&mut self, source: &Self)