Skip to main content

Request

Enum Request 

Source
pub enum Request {
    Hello {
        version: Version,
    },
    Describe,
    Availability,
    Applies {
        action: String,
    },
    Status,
    LiveChoices {
        id: String,
    },
    Perform {
        action: String,
        params: BTreeMap<String, ParamValue>,
        value: Option<u16>,
    },
    BoundInputs {
        action: String,
        inputs: Vec<String>,
    },
    HeldInputs {
        action: String,
        held: Vec<String>,
    },
    Configure {
        values: BTreeMap<String, String>,
    },
    ReadSignals,
    Shutdown,
}
Expand description

What the daemon asks an addon to do.

Deliberately not #[non_exhaustive], matching DeviceEvent and Effect in the daemon and for the same reason: a wildcard arm is how a newly added request gets silently ignored. Adding one should fail to compile in every implementation that has to answer it.

Variants§

§

Hello

Version handshake. Always first.

Fields

§version: Version

What the daemon speaks.

§

Describe

Everything static about the addon: what it is and what it offers.

One request rather than six, because none of it changes while the addon runs and six round trips at startup would be six chances to be half described.

§

Availability

Whether it could act right now.

§

Applies

Whether one action is worth offering at the moment.

Fields

§action: String

Which one.

§

Status

A sentence for the interface, if it has one.

§

LiveChoices

The current options for a live choice source (ADR-0022).

Sent when somebody opens a picker, and at no other time — never on a timer, which would cost idle CPU for a menu nobody has open.

Fields

§id: String

Which named source.

§

Perform

Do something.

Fields

§action: String

Which action.

§params: BTreeMap<String, ParamValue>

What the binding was configured with (ADR-0012).

Omitted when empty, and value when absent. Most performs are a bare press, and "params":{},"value":null on every one of them is noise in a log somebody is reading to find out what happened.

§value: Option<u16>

The fader position for a continuous action, absent for a press.

§

BoundInputs

The inputs bound to one action, in device order (006-FR-014a).

Sent unprompted whenever the set or its order changes, which is the one place the daemon tells an addon something rather than asking it. It is still a request on the wire — the addon answers Done — because a second message shape would need a second reader at both ends.

Fields

§action: String

Which of the addon’s actions.

§inputs: Vec<String>

Every input bound to it, already sorted.

§

HeldInputs

Which of one action’s inputs the user is holding right now.

Sent when the set changes. Empty is the ordinary case and is omitted on the wire, so an addon that never receives one has nothing held — which is also what an older host that never sends one means.

Fields

§action: String

Which of the addon’s actions.

§held: Vec<String>

The inputs currently held, in the same vocabulary as Self::BoundInputs.

§

Configure

Take these settings.

Fields

§values: BTreeMap<String, String>

By setting id.

§

ReadSignals

Read every signal it publishes, now.

§

Shutdown

Stop. The addon should exit; the daemon kills it if it does not.

Trait Implementations§

Source§

impl Clone for Request

Source§

fn clone(&self) -> Request

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Request

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Request

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Request

Source§

fn eq(&self, other: &Request) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Request

Source§

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

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Request

Source§

impl StructuralPartialEq for Request

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,