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 PartialOrd for DateTime
impl PartialOrd for DateTime
impl Copy for DateTime
impl Eq for DateTime
impl StructuralPartialEq for DateTime
Auto Trait Implementations§
impl Freeze for DateTime
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
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