morse_codec

Module message

source
Expand description

Message struct to hold decoded message or message to be encoded.

Client code can use this to access and manipulate the internal message of [MorseDecoder] or [MorseEncoder]:

// Get a decoded message
let decoded_message = decoder.message.as_str();
let decoded_message_bytes = decoder.message.as_bytes();
// ...Do something with the message...

// Clear the message
decoder.message.clear();

// Set message to something different
// and continue decoding from the end
decoder.set_message("SOME INITIAL MESSAGE", true);

// We continue sending signals
decoder.signal_event(125, true);
decoder.signal_event(200, false);
....

// To show an editing cursor on the screen
let editing_position = decoder.message.get_edit_pos();

Structsยง