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 PartialOrd for Date
impl PartialOrd for Date
impl Copy for Date
impl Eq for Date
impl StructuralPartialEq for Date
Auto Trait Implementations§
impl Freeze for Date
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more