pub struct TargetCandidate {
pub target: String,
pub label: String,
pub glyph: String,
pub service_type: Option<String>,
pub routes: Option<Vec<Route>>,
}Expand description
One entry in Mapping::target_candidates. During selection mode the
device displays glyph and, on confirm, the mapping’s service_target
is replaced with target.
Optional service_type and routes overrides let a single mapping’s
candidates straddle services — e.g. long_press cycles between a Roon
zone (rotate→volume_change) and a Hue light (rotate→brightness_change),
each with its own route table. When absent, the candidate inherits the
mapping’s service_type / routes, which matches pre-override behavior
so historical mappings deserialize unchanged.
Fields§
§target: StringThe service_target value to switch to (e.g. a Roon zone ID).
label: StringHuman-readable label for the UI only — the edge does not need it.
glyph: StringName of a glyph in the edge’s glyph registry to display while this candidate is highlighted in selection mode.
service_type: Option<String>Override the mapping’s service_type when this candidate is active.
None = inherit from the parent Mapping::service_type.
routes: Option<Vec<Route>>Override the mapping’s routes when this candidate is active. Required
in practice whenever service_type differs from the mapping’s, because
intents are service-specific (Roon volume_change won’t work against
a Hue target). None = inherit from the parent Mapping::routes.
Trait Implementations§
Source§impl Clone for TargetCandidate
impl Clone for TargetCandidate
Source§fn clone(&self) -> TargetCandidate
fn clone(&self) -> TargetCandidate
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more