Lines
100 %
Functions
Branches
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct Date {
pub year: u32,
pub month: u8,
pub day: u8,
}
#[derive(Debug, Clone, Eq, PartialEq, Default)]
pub struct Time {
pub hour: u8,
pub minute: u8,
pub second: u8,
pub is_utc: bool,
pub struct DateTime {
pub date: Date,
pub time: Time,
pub struct Duration {
pub sign: i8,
pub weeks: Option<u64>,
pub days: Option<u64>,
pub hours: Option<u64>,
pub minutes: Option<u64>,
pub seconds: Option<u64>,
impl Default for Duration {
fn default() -> Self {
Duration {
sign: 1,
weeks: None,
days: None,
hours: None,
minutes: None,
seconds: None,
pub struct Period {
pub start: DateTime,
pub end: PeriodEnd,
pub enum PeriodEnd {
DateTime(DateTime),
Duration(Duration),
pub struct UtcOffset {
pub hours: u64,
pub minutes: u64,
pub enum DateOrDateTime {
Date(Date),
pub enum DateOrDateTimeOrPeriod {
Period(Period),