Struct rhit::Date[][src]

pub struct Date {
    pub year: u16,
    pub month: u8,
    pub day: u8,
}

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: u16month: u8day: u8

Implementations

impl Date[src]

pub fn new(year: u16, month: u8, day: u8) -> Result<Self, DateParseError>[src]

pub fn from_nginx(s: &str) -> Result<Self, DateParseError>[src]

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

pub fn with_implicit(
    s: &str,
    default_year: Option<u16>,
    default_month: Option<u8>
) -> Result<Self, DateParseError>
[src]

parse a numeric date with optionally implicit parts The part separator is the ‘/’

Trait Implementations

impl Clone for Date[src]

impl Copy for Date[src]

impl Debug for Date[src]

impl Display for Date[src]

impl Eq for Date[src]

impl Ord for Date[src]

impl PartialEq<Date> for Date[src]

impl PartialOrd<Date> for Date[src]

impl StructuralEq for Date[src]

impl StructuralPartialEq for Date[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Fun for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.