morse_lib/lib.rs
1//! # Morse Library
2//!
3//! Morse Library is a library parsing text and binary data
4//! to Morse Code and vice versa.
5//!
6//! Morse Library support International rules and codes for Morse
7//! Code, but if needed it support custom language(s) to convert any language-specific
8//! Morse Code implementations. The library provides **Lines**, **Dots** and **Whitespace**
9//! aliasing. That means output Morse Code could be not only lines, dots and whitespaces,
10//! but also any UTF-8 emoji or even text! Also the library support playing Morse Code by sound
11//! if needed, and customization of speed, frequency of playing.
12//!
13//! ## Extend multimultilingualism
14//!
15//! To provide custom language conversion the library has struct MorseCustom. The constructor accept two functions:
16//! - first that match conversion from character to Morse Code
17//! - second that match conversion from Morse Code to Character
18//!
19//! ## Features
20//! * international (default)
21//! * custom
22//! * audio
23//!
24//! ## Data formats
25//!
26//! The following is a list of data formats that have been implemented
27//! for Morse Library.
28//!
29//! ### Input
30//!
31//! - [String], the casual String or &str that contains text
32//! - [Binary String], the casual String or &str that contains Morse Code represented by byte code.
33//!
34//! ### Output
35//!
36//! - [String], the casual String that contains Morse Code. By default **lines** and **dots**, but could be
37//! any UTF-8 character or even string
38//! - [Binary String], the casual String that contains Morse Code represented by byte code.
39//! - [Sound], sound representation of Morse Code
40//!
41//! ## Use
42//!
43//! This is some examples as a dependency in Cargo.toml of enabling/disabling features in library:
44//! ```toml
45//! // for international Morse code, no audio:
46//! morse-lib = "0.4.1"
47//! // for all features:
48//! morse-lib = { version = "0.4.1", features = ["custom", "audio"] }
49//! // for custom Morse code only:
50//! morse-lib = { version = "0.4.1", default-features = false, features = ["custom"] }
51//! // for custom Morse code only and audio features:
52//! morse-lib = { version = "0.4.1", default-features = false, features = ["custom", "audio"] }
53//! ```
54
55// Private modules
56mod morse_char;
57use morse_char::*;
58
59mod morse_processors;
60use morse_processors::*;
61
62mod display_chars;
63use display_chars::DisplayChars;
64
65#[cfg(feature = "audio")]
66mod sound;
67#[cfg(feature = "audio")]
68pub use sound::Sound;
69
70// Public modules
71mod morse_unit;
72pub use morse_unit::MorseUnit;
73
74mod error;
75pub use error::*;
76
77mod morse;
78#[cfg(feature = "international")]
79pub use morse::Morse;
80#[cfg(feature = "custom")]
81pub use morse::MorseCustom;
82pub use morse::TMorse;