Struct fxbox_thinkerbell::ast::Match [] [src]

pub struct Match<Ctx> where Ctx: Context {
    pub source: Vec<GetSelector>,
    pub kind: ChannelKind,
    pub range: Range,
    pub phantom: Phantom<Ctx>,
}

An individual match.

Matchs always take the form: "data received from input channel is in given range".

A condition is true if any of the corresponding input channels yielded a value that is in the given range.

Fields

source

The set of inputs to watch. Note that the set of inputs may change (e.g. when devices are added/removed) without rebooting the script.

kind

The kind of channel expected from source, e.g. "the current time of day", "is the door opened?", etc. During compilation, we make sure that we restrict to the elements of source that offer kind.

range

The range of values for which the condition is considered met. During compilation, we check that the type of range is compatible with that of input.

phantom

Trait Implementations

impl<Ctx: Deserialize> Deserialize for Match<Ctx> where Ctx: Context

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

impl<Ctx: Serialize> Serialize for Match<Ctx> where Ctx: Context

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