pub struct TimeTuple { /* private fields */ }
Expand description

A wrapper for a particular time of day.

Precise to second-level.

NOTE: This cannot be 24 hours or greater - see TimeTuple::new() for more details.

The wrapping described in TimeTuple::new() also applies when adding and subtracting times.

Implementations§

Produces a new TimeTuple.

Times of 24 hours or greater and negative times will wrap around 24 hours to always produce a positive time.

The value is calculated from total number of seconds so a time with a minute value of 90 would add an hour to the resulting tuple and set the minutes to 30, for example.

Same as TimeTuple::new() but takes the total number of seconds as its argument and calculates the hours, minutes, and seconds from that.

Returns a TimeTuple of the current time as std::time::SystemTime provides it.

Produces a string such as 08:30 for 8 hours and 30 minutes.

Ignores seconds.

Gets the total number of seconds in the tuple.

Adds a number of seconds to the TimeTuple, wrapping the same way TimeTuple::new() does.

Subtracts a number of seconds from the TimeTuple, wrapping the same way TimeTuple::new() does.

Adds a number of minutes to the TimeTuple, wrapping the same way TimeTuple::new() does.

Subtracts a number of minutes from the TimeTuple, wrapping the same way TimeTuple::new() does.

Adds a number of hours to the TimeTuple, wrapping the same way TimeTuple::new() does.

Subtracts a number of hours from the TimeTuple, wrapping the same way TimeTuple::new() does.

Trait Implementations§

The resulting type after applying the + operator.
Performs the + operation. Read more
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
Formats the value using the given formatter. Read more
Converts to this type from the input type.
The associated error which can be returned from parsing.
Parses a string s to return a value of this type. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
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
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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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.