1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use crate::{calendars::Calendar, timezone::Tz};

pub trait IsLeap {
    fn is_leap(year: i64) -> bool;
}

pub trait CalendarDatetime {
    fn ymd_hms(&self) -> Result<(i64, u8, u8, u8, u8, u8), crate::errors::Error>;
    fn timestamp(&self) -> i64;
    fn nanoseconds(&self) -> u32;
    fn timezone(&self) -> Tz;
    fn calendar(&self) -> Calendar;
}
pub trait CalendarDatetimeCreator
where
    Self: Sized,
{
    fn from_ymd_hms(
        year: i64,
        month: u8,
        day: u8,
        hour: u8,
        minute: u8,
        second: f32,
    ) -> Result<Self, crate::errors::Error>;
    fn from_timestamp(timestamp: i64, nanoseconds: u32) -> Self;
}