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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// https://github.com/rust-lang/cargo/issues/383#issuecomment-720873790
#[cfg(doctest)]
mod test_readme {
    macro_rules! external_doc_test {
        ($x:expr) => {
            #[doc = $x]
            extern {}
        }
    }

    external_doc_test!(include_str!("../README.md"));
}

#[macro_use] extern crate nom;

macro_rules! impl_fromstr_parse {
    ($ty:ty, $func:ident) => {
        impl ::std::str::FromStr for $ty {
            type Err = ();

            fn from_str(s: &str) -> Result<Self, Self::Err> {
                ::parse::$func(s.as_bytes())
                    .map(|x| x.1)
                    .or(Err(()))
            }
        }
    }
}

mod date;
mod time;
mod datetime;
mod parse;
pub mod chrono;

pub use {
    date::*,
    time::*,
    datetime::*
};

pub trait Valid {
    fn is_valid(&self) -> bool;
}