morse_codec::charsets

Type Alias CharacterSet

Source
pub type CharacterSet = &'static [Character];
Expand description

Client code can use this type to construct a different character mapping to morse code and construct the decoder or encoder with this custom character set.

Empty character b’ ’ should be added at the beginning. It does not include special characters longer than 6 signals to keep arrays small. So no $ sign for ya. In order to change it and use a different mapping, client code can use CharacterSet type to construct an array of u8 with [CHARACTER_SET_LENGTH].

ⓘ
let my_set: CharacterSet = b" ADD SOME CHARACTERS TO THIS BYTE STRING"];
// Or with 'utf8' feature
let my_set: CharacterSet = &[' ', ...FILL IN THE CHARS...];
// Then
let decoder = Decoder::<128>::new().with_character_set(my_set).build();

Allows creating a custom character set.