Struct below_common::dateutil::HgTime[][src]

pub struct HgTime {
    pub unixtime: u64,
    pub offset: i32,
}
Expand description

A simple time structure that matches hg’s time representation.

Internally it’s unixtime (in GMT), and offset (GMT -1 = +3600).

Fields

unixtime: u64offset: i32

Implementations

Parse a date string.

Return None if it cannot be parsed.

This function matches mercurial.util.parsedate, and can parse some additional forms like 2 days ago. It can also handle future forms like “ten hours from now” and “+10h”

Parse a date string as a range.

For example, Apr 2000 covers range Apr 1, 2000 to Apr 30, 2000. Also support more explicit ranges:

  • START to END
  • START

  • < END

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Calls the given closure and return the result. Read more

Calls the given closure on self.

Calls the given closure on self.

Calls the given closure if condition == true.