morse_nostd/
lib.rs

1/*!
2This crate provides a library for encoding and decoding morse code
3
4This crate's documentation provides some simple examples on how to use it.
5*/
6
7#![no_std]
8#![deny(missing_docs)]
9
10#[cfg(all(feature = "alloc", not(feature = "std")))]
11extern crate alloc;
12#[cfg(feature = "std")]
13extern crate std as alloc;
14
15#[macro_use]
16extern crate alloc;
17use alloc::string::String;
18use alloc::vec::Vec;
19
20/// The structure that is returned if the encode or decode functions failed.
21#[derive(Debug)]
22pub struct TranslationError {
23    /// Vec of all unsupported characters causing the error.
24    pub unsupported_characters: Vec<String>,
25    /// The completed parse result. Failed characters have been replaced by `#`
26    pub result: String,
27}
28
29pub mod encode;
30pub mod decode;