Struct chrono_elapsed::Elapsed[][src]

pub struct Elapsed { /* fields omitted */ }
Expand description

Provides a context-aware DateTime object; a given DateTime is made aware in the context of the current DateTime (or in the context of a given DateTime, see new_with_context.)

Allows you to easily obtain information such as datetime is due in 42 minutes and 30 seconds, datetime is overdue by 3 days and 2 hours, or when given context, time between x and y is 42 years and 9 months.

Aliased as DueDateTime out of the box in case that makes more sense in your context.

Implementations

Construct a new object.

Construct a new object from a Date rather than DateTime.

Construct a new object and then add Local timezone.

Construct a new object from a Date then add Local timezone.

Construct a new object with a custom context, rather than the default now.

Construct a new object from a Date with a custom context.

Set the Elapsed’s datetime_context. Will clear cached diff values.

Set the Elapsed’s datetime. Will clear cached diff values.

Set the Elapsed’s date. Will clear cached diff values.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Construct from localised Date.

Construct from UTC Date.

Construct from localised DateTime.

Construct from UTC DateTime.

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

Converts the given value to a String. 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.