CodeMapper

Trait CodeMapper 

Source
pub trait CodeMapper {
    // Required methods
    fn to_code(&self, platform: Platform) -> usize;
    fn from_code(code: usize, platform: Platform) -> Option<Self>
       where Self: Sized;
}
Expand description

HashMap implementation of the CodeMapper trait

Required Methods§

Source

fn to_code(&self, platform: Platform) -> usize

Convert the button to a platform-specific code

Source

fn from_code(code: usize, platform: Platform) -> Option<Self>
where Self: Sized,

Parse a button from a platform-specific code

Implementors§