KeyLayoutMapper

Trait KeyLayoutMapper 

Source
pub trait KeyLayoutMapper: KeyMapping {
    // Required methods
    fn to_channel_id(self) -> NoteChannelId;
    fn from_channel_id(channel_id: NoteChannelId) -> Option<Self>
       where Self: Sized;
}
Expand description

Trait for key channel mode implementations.

This trait defines the interface for converting between different key channel modes and the standard [ChannelId] format. Each mode implementation should provide methods to convert from its own format to [ChannelId] format and vice versa.

Required Methods§

Source

fn to_channel_id(self) -> NoteChannelId

Convert from this mode’s format to [ChannelId] format.

This method takes a (PlayerSide, NoteKind, Key) tuple in this mode’s format and converts it to the equivalent [ChannelId] in [ChannelId] format.

Source

fn from_channel_id(channel_id: NoteChannelId) -> Option<Self>
where Self: Sized,

Convert from [ChannelId] format to this mode’s format.

This method takes a [ChannelId] in [ChannelId] format and converts it to the equivalent (PlayerSide, NoteKind, Key) tuple in this mode’s format.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§