Struct mail_parser::DateTime
source · [−]pub struct DateTime {
pub year: u32,
pub month: u32,
pub day: u32,
pub hour: u32,
pub minute: u32,
pub second: u32,
pub tz_before_gmt: bool,
pub tz_hour: u32,
pub tz_minute: u32,
}
Expand description
An RFC5322 datetime.
Fields
year: u32
month: u32
day: u32
hour: u32
minute: u32
second: u32
tz_before_gmt: bool
tz_hour: u32
tz_minute: u32
Implementations
sourceimpl DateTime
impl DateTime
sourcepub fn to_iso8601(&self) -> String
pub fn to_iso8601(&self) -> String
Returns an ISO-8601 representation of the parsed RFC5322 datetime field
sourcepub fn to_timestamp(&self) -> Option<i64>
pub fn to_timestamp(&self) -> Option<i64>
Returns the numbers of seconds since 1970-01-01T00:00:00Z (Unix epoch) or None if the date is invalid.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for DateTime
impl<'de> Deserialize<'de> for DateTime
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Ord for DateTime
impl Ord for DateTime
sourceimpl PartialOrd<DateTime> for DateTime
impl PartialOrd<DateTime> for DateTime
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for DateTime
impl StructuralEq for DateTime
impl StructuralPartialEq for DateTime
Auto Trait Implementations
impl RefUnwindSafe for DateTime
impl Send for DateTime
impl Sync for DateTime
impl Unpin for DateTime
impl UnwindSafe for DateTime
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more