pub enum Intent {
Show 18 variants
Play,
Pause,
PlayPause,
Stop,
Next,
Previous,
VolumeChange {
delta: f64,
},
VolumeSet {
value: f64,
},
Mute,
Unmute,
SeekRelative {
seconds: f64,
},
SeekAbsolute {
seconds: f64,
},
BrightnessChange {
delta: f64,
},
BrightnessSet {
value: f64,
},
ColorTemperatureChange {
delta: f64,
},
PowerToggle,
PowerOn,
PowerOff,
}Expand description
Service-level intent produced by the routing engine. Adapters translate this into their service’s native command.
Variants§
Play
Pause
PlayPause
Stop
Next
Previous
VolumeChange
VolumeSet
Mute
Unmute
SeekRelative
SeekAbsolute
BrightnessChange
BrightnessSet
ColorTemperatureChange
PowerToggle
PowerOn
PowerOff
Implementations§
Source§impl Intent
impl Intent
Sourcepub fn split(&self) -> (String, Value)
pub fn split(&self) -> (String, Value)
Serialize the intent into its snake-case discriminant + remaining
params payload — matches the on-wire shape of
EdgeToServer::Command and EdgeToServer::DispatchIntent. Used
by both the dispatch telemetry frame and cross-edge intent
forwarding so both ends see the same encoding.
Sourcepub fn reassemble(intent: &str, params: &Value) -> Result<Self, Error>
pub fn reassemble(intent: &str, params: &Value) -> Result<Self, Error>
Inverse of split: reassemble an Intent from its snake-case
discriminant and params payload. Used on the receiving end of
ServerToEdge::DispatchIntent. Returns Err if intent does
not name a known variant or if params shape doesn’t match.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Intent
impl<'de> Deserialize<'de> for Intent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Intent
Auto Trait Implementations§
impl Freeze for Intent
impl RefUnwindSafe for Intent
impl Send for Intent
impl Sync for Intent
impl Unpin for Intent
impl UnsafeUnpin for Intent
impl UnwindSafe for Intent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more