pub struct DateTime {
pub date: Date,
pub time: Time,
}
Expand description
a date with time.
It’s implicitely in the timezone of the log files (assuming all the files have the same one).
Fields§
§date: Date
§time: Time
Implementations§
source§impl DateTime
impl DateTime
pub fn new( year: u16, month: u8, day: u8, hour: u8, minute: u8, second: u8 ) -> Result<Self, ParseDateTimeError>
sourcepub fn from_nginx(s: &str) -> Result<Self, ParseDateTimeError>
pub fn from_nginx(s: &str) -> Result<Self, ParseDateTimeError>
parse the date_time part of a nginx log line
a datetime in nginx is either in
- “common log format”, eg
10/Jan/2021:10:27:01 +0000
- ISO 8601, eg
1977-04-22T01:00:00-05:00
pub fn round_up(date: Date, time: Option<Time>) -> Self
pub fn round_down(date: Date, time: Option<Time>) -> Self
Trait Implementations§
source§impl Ord for DateTime
impl Ord for DateTime
source§impl PartialEq<DateTime> for DateTime
impl PartialEq<DateTime> for DateTime
source§impl PartialOrd<DateTime> for DateTime
impl PartialOrd<DateTime> for DateTime
1.0.0 · source§fn 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 moreimpl Copy for DateTime
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§
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