[][src]Struct email::rfc822::Rfc822DateParser

pub struct Rfc822DateParser<'s> { /* fields omitted */ }

Parser for RFC822 style dates, as defined by Section 5.

Note that this also supports the additions as specified in RFC5322 Section 3.3 while still being backward compatible. [unstable]

Methods

impl<'s> Rfc822DateParser<'s>[src]

pub fn new(s: &'s str) -> Rfc822DateParser<'s>[src]

[unstable]

pub fn consume_datetime(&mut self) -> ParsingResult<DateTime<FixedOffset>>[src]

Consume a DateTime from the input.

If successful, returns a DateTime with a fixed offset based on the timezone parsed. You may wish to deal with this in UTC, in which case you may want something like

use email::rfc822::Rfc822DateParser;
use chrono::Utc;

let mut p = Rfc822DateParser::new("Thu, 18 Dec 2014 21:07:22 +0100");
let d = p.consume_datetime().unwrap();
let as_utc = d.with_timezone(&Utc);

assert_eq!(d, as_utc);

[unstable]

Auto Trait Implementations

impl<'s> RefUnwindSafe for Rfc822DateParser<'s>

impl<'s> Send for Rfc822DateParser<'s>

impl<'s> Sync for Rfc822DateParser<'s>

impl<'s> Unpin for Rfc822DateParser<'s>

impl<'s> UnwindSafe for Rfc822DateParser<'s>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,