pub struct AbsoluteTime {
pub text: String,
pub value: Option<NaiveDateTime>,
}
Expand description
Represents an absolute, timezone-unaware timestamp.
AbsoluteTime
keeps both the raw textual representation (text
) and the
parsed value as a NaiveDateTime
(value
). The timestamp is naive
(i.e., it has no timezone or offset information) and should not be used for
DST/offset-sensitive computations without attaching a timezone.
If the input line does not start with "date"
or the timestamp does not
match the expected format, parsing returns None
.
§Fields
text
: The raw timestamp string after the leading"date "
prefix (e.g.,"Tue Aug 05 07:23:45.123 pm 2025"
).value
: The parsed timestamp asSome(NaiveDateTime)
on success, orNone
if not available.
Fields§
§text: String
§value: Option<NaiveDateTime>
Implementations§
Trait Implementations§
Source§impl Clone for AbsoluteTime
impl Clone for AbsoluteTime
Source§fn clone(&self) -> AbsoluteTime
fn clone(&self) -> AbsoluteTime
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AbsoluteTime
impl Debug for AbsoluteTime
Source§impl Default for AbsoluteTime
impl Default for AbsoluteTime
Source§fn default() -> AbsoluteTime
fn default() -> AbsoluteTime
Returns the “default value” for a type. Read more
Source§impl PartialEq for AbsoluteTime
impl PartialEq for AbsoluteTime
impl StructuralPartialEq for AbsoluteTime
Auto Trait Implementations§
impl Freeze for AbsoluteTime
impl RefUnwindSafe for AbsoluteTime
impl Send for AbsoluteTime
impl Sync for AbsoluteTime
impl Unpin for AbsoluteTime
impl UnwindSafe for AbsoluteTime
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