Function time
const fn time(hour: i8, minute: i8, second: i8, subsec_nanosecond: i32) -> Time
Creates a new Time value in a const context.
This is a convenience free function for Time::constant. It is intended
to provide a terse syntax for constructing Time values from parameters
that are known to be valid.
Panics
This panics if the given values do not correspond to a valid Time.
All of the following conditions must be true:
0 <= hour <= 230 <= minute <= 590 <= second <= 590 <= subsec_nanosecond <= 999,999,999
Similarly, when used in a const context, invalid parameters will prevent your Rust program from compiling.
Example
This shows an example of a valid time in a const context:
use Time;
const BEDTIME: Time = constant;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;