Function morse_nostd::decode::decode [−][src]
pub fn decode<S: Into<String>>(input: S) -> Result<String, TranslationError>
Decodes a morse representation string into an ascii string
Examples
use morse_nostd::decode; assert_eq!(decode::decode("... ___ ...").unwrap(), "sos");
Errors
Decoding will error with a morse::TranslationError
when an unsupported morse character is being decoded.
The error structure contains a Vec<String> unsupported_characters
to show what characters failed.
Note: The input will still complete parsing.