Enum fxbox_taxonomy::devices::ChannelKind [] [src]

pub enum ChannelKind {
    Ready,
    OnOff,
    OpenClosed,
    CurrentTime,
    CurrentTimeOfDay,
    RemainingTime,
    Thermostat,
    ActualTemperature,
    Extension {
        vendor: String,
        adapter: String,
        kind: String,
        typ: Type,
    },
}

The kind of the service, i.e. a strongly-typed description of what the service can do. Used both for locating services (e.g. "I need a clock" or "I need something that can provide pictures") and for determining the data structure that these services can provide or consume.

A number of service kinds are standardized, and provided as a set of strongly-typed enum constructors. It is clear, however, that many devices will offer services that cannot be described by pre-existing constructors. For this purpose, this enumeration offers a constructor Extension, designed to describe novel services.

Variants

Ready

No payload

The service is ready. Used for instance once a countdown has reached completion.

OnOff

Boolean

The service is used to detect or decide whether some device is on or off.

OpenClosed

The service is used to detect or decide whether some device is open or closed.

CurrentTime

Time

The service is used to read or set the current absolute time. Used for instance to wait until a specific time and day before triggering an action, or to set the appropriate time on a new device.

CurrentTimeOfDay

The service is used to read or set the current time of day. Used for instance to trigger an action at a specific hour every day.

RemainingTime

The service is part of a countdown. This is the time remaining until the countdown is elapsed.

Thermostat
ActualTemperature
Extension

TODO: Add more An operation of a kind that has not been standardized yet.

Fields

vendor

The vendor. Used for namespacing purposes, to avoid confusing two incompatible extensions with similar names. For instance, "foxlink@mozilla.com".

adapter

Identification of the adapter introducing this operation. Designed to aid with tracing and debugging.

kind

A string describing the nature of the value, designed to let applications discover the devices.

Examples: "GroundHumidity".

typ

The data type of the value.

Methods

impl ChannelKind

fn get_type(&self) -> Type

Get the type of values used to communicate with this service.

Trait Implementations

impl Deserialize for ChannelKind

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

impl Serialize for ChannelKind

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

Derived Implementations

impl PartialEq for ChannelKind

fn eq(&self, __arg_0: &ChannelKind) -> bool

fn ne(&self, __arg_0: &ChannelKind) -> bool

impl Clone for ChannelKind

fn clone(&self) -> ChannelKind

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

impl Debug for ChannelKind

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