#[non_exhaustive]pub enum ParamKind {
Text,
App,
}Expand description
What a parameter holds, so an interface can offer the right editor.
A hint, not a storage type — every parameter is stored as a string (ADR-0012). Widening this is additive; a client that does not recognise a kind falls back to a text box and stays useful.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Text
Free text.
App
An application identity, in whatever form the foreground watcher reports. The interface can offer “the application you were just in” rather than asking someone to type an executable name from memory.
Implementations§
Source§impl ParamKind
impl ParamKind
Sourcepub const fn as_wire(self) -> &'static str
pub const fn as_wire(self) -> &'static str
How it is spelled on a wire. See Trigger::as_wire for why this is
here rather than at each end.
Exhaustive, and that is the point of putting it in this crate. This
type is #[non_exhaustive], so every match on it outside the SDK must
carry a wildcard — which is how nobble_rpc::param_kind_name came to
have a ParamKind::Text | _ => "text" arm defending against a variant
that cannot exist in a build that compiled. Here the wildcard is not
required, so adding a kind fails to compile at the one site that has to
decide what it is called.
Sourcepub fn from_wire(s: &str) -> Option<Self>
pub fn from_wire(s: &str) -> Option<Self>
Read one back, or None if this build has no name for it.
Unlike Trigger::from_wire, defaulting is the documented behaviour
for a caller here: this type’s own note says widening it is additive and
a client that does not recognise a kind should offer a text box and stay
useful. The Option is still the honest return, because “I do not know
this one” and “this one is text” are different facts and only the caller
knows whether the difference matters to it.