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

parent

If Eactly(id), return only channels that are children of node id.

tags

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

kind

If Exatly(k), restrict results to channels that produce values of kind k.

poll

If Some(r), restrict results to channels that support polling with the acceptable period.

trigger

If Some(r), restrict results to channels that support trigger with the acceptable period.

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.

Trait Implementations

impl Deserialize for GetSelector

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

impl Serialize for GetSelector

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

Derived Implementations

impl Default for GetSelector

fn default() -> GetSelector

impl Debug for GetSelector

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

impl Clone for GetSelector

fn clone(&self) -> GetSelector

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