pub struct Parse<'z, Tz2> { /* private fields */ }Expand description
Parse struct has methods implemented parsers for accepted formats.
Implementations§
Source§impl<'z, Tz2> Parse<'z, Tz2>where
Tz2: TimeZone,
impl<'z, Tz2> Parse<'z, Tz2>where
Tz2: TimeZone,
Sourcepub const fn new(tz: &'z Tz2, default_time: NaiveTime) -> Self
pub const fn new(tz: &'z Tz2, default_time: NaiveTime) -> Self
Create a new instance of Parse with a custom parsing timezone that handles the
datetime string without time offset.
pub const fn prefer_dmy(&mut self, yes: bool) -> &Self
Sourcepub const fn new_with_preference(
tz: &'z Tz2,
default_time: NaiveTime,
prefer_dmy: bool,
) -> Self
pub const fn new_with_preference( tz: &'z Tz2, default_time: NaiveTime, prefer_dmy: bool, ) -> Self
Create a new instance of Parse with a custom parsing timezone that handles the
datetime string without time offset, and the date parsing preference.
Sourcepub fn parse(&self, input: &str) -> Result<DateTime<Utc>>
pub fn parse(&self, input: &str) -> Result<DateTime<Utc>>
This method tries to parse the input datetime string with a list of accepted formats. See
more examples from Parse, crate::parse() and crate::parse_with_timezone().
Auto Trait Implementations§
impl<'z, Tz2> Freeze for Parse<'z, Tz2>
impl<'z, Tz2> RefUnwindSafe for Parse<'z, Tz2>where
Tz2: RefUnwindSafe,
impl<'z, Tz2> Send for Parse<'z, Tz2>where
Tz2: Sync,
impl<'z, Tz2> Sync for Parse<'z, Tz2>where
Tz2: Sync,
impl<'z, Tz2> Unpin for Parse<'z, Tz2>
impl<'z, Tz2> UnwindSafe for Parse<'z, Tz2>where
Tz2: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more