koyomi_rs/
lib.rs

1//! # A library for handling traditional Japanese customs.
2//!
3//! This library handles various information related to dates based on
4//! Japanese unique customs and practices.
5//!
6//! This library heavily relies on the [`chrono`] for various caluculation and comparisions.
7//!
8//! ## Overview
9//!
10//! ### Year
11//!
12//! In Japan, in addition to Gregorian calendar, the Japanese era system is also used.
13//!
14//! Using [`JapaneseEra`], it is possible to derive the Japanese era from the Gregorian calendar.
15//!
16//! Please note that it is not possible to derive Japanese eras before the Meiji era.
17//! Prior to the Meiji era, the derivation is based on the lunar calendar, which is not currentry supported.
18//!
19//! ### Month
20//!
21//! In Japan, there are unique names for months similar to how _January_ is for first month
22//! and _Febrary_ for second months in English.
23//!
24//! By using [`JapaneseMonth`], it is possible to derive these.
25//!
26//! ### Weekday
27//!
28//! Similarly to months, there are unique names for weekday in Japanese.
29//!
30//! By using [`JapaneseWeekday`], it is possible to derive these.
31//!
32//! ### Day and holiday
33//!
34//! The representation of days itself is not specifically supported by this library.
35//! However, due to the numerous unique Japanese holidays, this is supported in the library.
36//!
37//! By using [`JapaneseHoliday`], it is possible to derive these.
38//!
39//! ### Calendar
40//!
41//! It supports generating calendars using each of the above,
42//! including both common Gregorian dates and Japanese-specific expression.
43//!
44//! By using [`Koyomi`], you can generate calendars.
45mod day;
46pub use day::{JapaneseHoliday, JapaneseWeekday};
47
48mod era;
49pub use era::JapaneseEra;
50
51mod internal;
52
53mod koyomi;
54pub use koyomi::{JapaneseDate, Koyomi};
55
56mod month;
57pub use month::JapaneseMonth;
58
59mod year;
60pub use year::{HeavenlyStem, JapaneseZodiac, SexagenaryCycle};
61
62pub mod prelude {
63    pub use crate::day::{JapaneseHoliday, JapaneseWeekday};
64    pub use crate::era::JapaneseEra;
65    pub use crate::koyomi::{JapaneseDate, Koyomi};
66    pub use crate::month::JapaneseMonth;
67    pub use crate::year::{HeavenlyStem, JapaneseZodiac, SexagenaryCycle};
68}