pub struct Encoder<const MSG_MAX: usize> { /* private fields */ }Implementations§
source§impl<const MSG_MAX: usize> Encoder<MSG_MAX>
impl<const MSG_MAX: usize> Encoder<MSG_MAX>
pub fn new() -> Self
sourcepub fn with_message(self, message_str: &str, edit_pos_end: bool) -> Self
pub fn with_message(self, message_str: &str, edit_pos_end: bool) -> Self
Build encoder with a starting message.
edit_pos_end means we’ll continue encoding from the end of this string. If you pass false to it, we’ll start from the beginning.
sourcepub fn with_edit_position(self, pos: usize) -> Self
pub fn with_edit_position(self, pos: usize) -> Self
Build encoder with an arbitrary editing start position.
Maybe client code saved the previous editing position to an EEPROM, harddisk, local storage in web and wants to continue from that.
sourcepub fn with_character_set(self, character_set: CharacterSet) -> Self
pub fn with_character_set(self, character_set: CharacterSet) -> Self
Use a different character set than default english alphabet.
This can be helpful to create a message with trivial encryption. Letters can be shuffled for example. This kind of encryption can easily be broken with powerful algorithms and AI. DON’T use it for secure communication.
sourcepub fn build(self) -> MorseEncoder<MSG_MAX>
pub fn build(self) -> MorseEncoder<MSG_MAX>
Build and get yourself a shiny new MorseEncoder.
The ring is yours now…
Trait Implementations§
Auto Trait Implementations§
impl<const MSG_MAX: usize> Freeze for Encoder<MSG_MAX>
impl<const MSG_MAX: usize> RefUnwindSafe for Encoder<MSG_MAX>
impl<const MSG_MAX: usize> Send for Encoder<MSG_MAX>
impl<const MSG_MAX: usize> Sync for Encoder<MSG_MAX>
impl<const MSG_MAX: usize> Unpin for Encoder<MSG_MAX>
impl<const MSG_MAX: usize> UnwindSafe for Encoder<MSG_MAX>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more