pub struct SoftKeyProfile { /* private fields */ }Expand description
Ordered soft-key actions advertised for every known station key mode.
The protocol template remains the canonical 32-entry action catalog; these sets choose which catalog entries appear in each mode and in which order.
Implementations§
Source§impl SoftKeyProfile
impl SoftKeyProfile
Sourcepub const MAX_KEYS_PER_MODE: usize = 16
pub const MAX_KEYS_PER_MODE: usize = 16
Maximum number of actions that one station key mode can advertise.
Sourcepub fn new(
sets: impl IntoIterator<Item = (KeyMode, Vec<SoftKey>)>,
) -> Result<Self, CodecError>
pub fn new( sets: impl IntoIterator<Item = (KeyMode, Vec<SoftKey>)>, ) -> Result<Self, CodecError>
Builds and validates a complete profile.
Every known KeyMode must occur exactly once. Use Self::empty as
a convenient base when only a few modes should expose actions.
pub fn empty() -> Self
Sourcepub fn built_in() -> Self
pub fn built_in() -> Self
The wire-compatible profile used when a station has no configured override.
pub fn actions(&self, mode: KeyMode) -> &[SoftKey]
pub fn allows(&self, mode: KeyMode, action: SoftKey) -> bool
Sourcepub fn valid_mask(&self, mode: KeyMode) -> u32
pub fn valid_mask(&self, mode: KeyMode) -> u32
Returns the station bit mask enabling every configured action in mode.
Sourcepub fn template_actions(&self) -> Vec<SoftKey>
pub fn template_actions(&self) -> Vec<SoftKey>
Actions whose labels are needed in the station template. The built-in profile intentionally retains the historical complete catalog bytes.
Sourcepub fn validate(&self) -> Result<(), CodecError>
pub fn validate(&self) -> Result<(), CodecError>
Verifies completeness, per-mode limits, known values, and uniqueness.
Trait Implementations§
Source§impl Clone for SoftKeyProfile
impl Clone for SoftKeyProfile
Source§fn clone(&self) -> SoftKeyProfile
fn clone(&self) -> SoftKeyProfile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more