rstmt_core/
lib.rs

1#![crate_name = "rstmt_core"]
2//! This crate provides the core functionality for the `rstmt` library, including [`Aspn`],
3//! [`NoteBase`], [`Pitch`], and [`Octave`]. Additionally, the crate provides a host of
4//! other primitives and utilities designed to manifest and manipulate musical concepts.
5#![allow(
6    clippy::derivable_impls,
7    clippy::len_without_is_empty,
8    clippy::missing_errors_doc,
9    clippy::missing_panics_doc,
10    clippy::missing_safety_doc,
11    clippy::module_inception,
12    clippy::needless_doctest_main,
13    clippy::non_canonical_partial_ord_impl,
14    clippy::should_implement_trait,
15    clippy::upper_case_acronyms
16)]
17#![cfg_attr(not(feature = "std"), no_std)]
18#![cfg_attr(feature = "nightly", feature(allocator_api))]
19// compiler check
20#[cfg(not(any(feature = "std", feature = "alloc")))]
21compile_error! { "either the \"std\" or \"alloc\" feature must be enabled" }
22// procedural macros
23#[macro_use]
24pub(crate) mod macros {
25    #[macro_use]
26    pub mod seal;
27    #[macro_use]
28    pub mod units;
29}
30
31#[cfg(feature = "alloc")]
32extern crate alloc;
33
34pub mod chord;
35pub mod comp;
36pub mod consts;
37pub mod error;
38pub mod freq;
39pub mod intervals;
40pub mod note;
41pub mod octave;
42pub mod pitch;
43
44pub mod types {
45    //! this module imimplements various types and other primitives used throughout the library
46    #[doc(inline)]
47    pub use self::{accents::*, harmonic_funcs::*, notes::*};
48
49    mod accents;
50    mod harmonic_funcs;
51    mod notes;
52}
53
54pub mod utils {
55    //! useful utilities for musical primitives for converting between different
56    //! representations, classification routines, and more.
57    #[doc(inline)]
58    pub use self::frequency::*;
59
60    mod frequency;
61}
62// re-exports
63#[doc(inline)]
64pub use self::{
65    chord::{RawChord, RawChordMut},
66    comp::Scale,
67    consts::*,
68    error::*,
69    freq::*,
70    intervals::*,
71    note::*,
72    octave::*,
73    pitch::*,
74    types::*,
75    utils::*,
76};
77#[doc(inline)]
78pub use rstmt_traits as traits;
79#[doc(inline)]
80pub use rstmt_traits::prelude::*;
81// prelude
82#[doc(hidden)]
83pub mod prelude {
84    pub use rstmt_traits::prelude::*;
85
86    pub use crate::chord::prelude::*;
87    pub use crate::comp::prelude::*;
88    pub use crate::consts::*;
89    pub use crate::freq::*;
90    pub use crate::intervals::prelude::*;
91    pub use crate::note::*;
92    pub use crate::octave::*;
93    pub use crate::pitch::prelude::*;
94    pub use crate::types::*;
95    pub use crate::utils::*;
96}