pub struct Date {
pub year: u16,
pub month: u8,
pub day: u8,
}
Expand description
a not precise date, only valid in the context of the local set of log files. It’s implicitely in the timezone of the log files (assuming all the files have the same one). As nginx didn’t exist before JC, a u16 is good enough for the year.
Fields§
§year: u16
§month: u8
§day: u8
Implementations§
source§impl Date
impl Date
pub fn new(year: u16, month: u8, day: 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 part of a nginx datetime.
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
sourcepub fn with_implicit(
s: &str,
default_year: Option<u16>,
default_month: Option<u8>
) -> Result<Self, ParseDateTimeError>
pub fn with_implicit( s: &str, default_year: Option<u16>, default_month: Option<u8> ) -> Result<Self, ParseDateTimeError>
parse a numeric date with optionally implicit parts The part separator is the ‘/’
Trait Implementations§
source§impl Ord for Date
impl Ord for Date
source§impl PartialEq<Date> for Date
impl PartialEq<Date> for Date
source§impl PartialOrd<Date> for Date
impl PartialOrd<Date> for Date
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 Date
impl Eq for Date
impl StructuralEq for Date
impl StructuralPartialEq for Date
Auto Trait Implementations§
impl RefUnwindSafe for Date
impl Send for Date
impl Sync for Date
impl Unpin for Date
impl UnwindSafe for Date
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