first_cargo_package/lib.rs
1/*!
2
3## Head1
4This is the documention test.
5see an [example](example/exmaple1/mains.rs#L2-L4)
6
7*/
8
9pub use self::kinds::PrimaryColor;
10pub use self::kinds::SecondaryColor;
11pub use self::utils::mix;
12
13pub mod kinds {
14 /// The primary colors according to the RYB color model.
15 pub enum PrimaryColor {
16 Red,
17 Yellow,
18 Blue,
19 }
20
21 /// The secondary colors according to the RYB color model.
22 pub enum SecondaryColor {
23 Orange,
24 Green,
25 Purple,
26 }
27}
28
29pub mod utils {
30 use crate::kinds::*;
31
32 /// Combines two primary colors in equal amounts to create
33 /// a secondary color.
34 pub fn mix(c1: PrimaryColor, c2: PrimaryColor) -> SecondaryColor {
35 SecondaryColor::Orange
36 }
37}