Struct fxbox_taxonomy::selector::GetSelector
[−]
[src]
pub struct GetSelector {
pub id: Exactly<Id<Get>>,
pub parent: Exactly<Id<NodeId>>,
pub tags: Vec<String>,
pub kind: Exactly<ChannelKind>,
pub poll: Option<Period>,
pub trigger: Option<Period>,
// some fields omitted
}A selector for one or more input channels.
Example
use fxbox_taxonomy::selector::*; use fxbox_taxonomy::devices::*; use fxbox_taxonomy::util::Id; let selector = GetSelector::new() .with_parent(Id::new("foxbox".to_owned())) .with_kind(ChannelKind::CurrentTimeOfDay);
Fields
id | If |
parent | If |
tags | Restrict results to channels that have all the tags in |
kind | If |
poll | If |
trigger | If |
Methods
impl GetSelector
fn new() -> Self
Create a new selector that accepts all input channels.
fn with_id(self, id: Id<Get>) -> Self
Restrict to a channel with a specific id.
fn with_parent(self, id: Id<NodeId>) -> Self
Restrict to a channel with a specific parent.
fn with_kind(self, kind: ChannelKind) -> Self
Restrict to a channel with a specific kind.
fn with_tags(self, tags: Vec<String>) -> Self
Restrict to channels that have all the tags in tags.
fn with_poll(self, period: Period) -> Self
Restrict to channels that support polling with the acceptable period
fn with_trigger(self, period: Period) -> Self
Restrict to channels that support trigger with the acceptable period
fn and(self, other: Self) -> Self
Restrict to channels that are accepted by two selector.
fn matches(&self, channel: &Channel<Get>) -> bool
Determine if a channel is matched by this selector.