[][src]Crate small_morse

Iterators over text in morse code.

fn wait_for(duration: u8) {
    // ...
}
fn beep_for(duration: u8) {
    // ...
}

for action in small_morse::encode("Hello in morse code!") {
    if action.state == small_morse::State::On {
        beep_for(action.duration);
    } else {
        wait_for(action.duration);
    }
}

This library is for encoding text into morse code (not the other way around yet).

It works without the standard library.

Structs

Action

An Action is how the library tells you what to signal.

MorseIter

A MorseIter is an iterator that yields Actions. Create a MorseIter with either the MorseIter::new method or the iter function.

Enums

DelayType

DelayType indicates whether a duration should be slowed down when using the Farnsworth method of learning Morse code.

State

Within an Action, whether it is to turn the signalling mechanism on or off

Functions

encode

Creates an iterator over the Actions necessary to send the message