Enum twilight_model::datetime::error::RangeField [−][src]
pub enum RangeField {
Day {
year: u16,
month: u8,
value: u8,
},
Hour {
value: u8,
},
Minute {
value: u8,
},
Month {
value: u8,
},
Second {
value: u8,
},
Year {
value: u16,
},
}Expand description
Field that is out of range.
During parsing of timestamps the values of fields - such as the hour or day portion of a timestamp - are validated. If one is outside of the accepted range then the function is short-circuited an an error is returned.
Variants
Day field is out of the acceptable range.
The acceptable ranges are:
- [1, 31] in the case of January, March, May, July, August, October, and December;
- [1, 30] in the case of April, June, September, and November;
- [1, 29] in the case of February on a leap year;
- [1, 28] in the case of February on a year that is not a leap year.
Fields of Day
Hour field is out of the acceptable range.
The acceptable range is [0, 23].
Fields of Hour
value: u8Provided value.
Minute field is out of the acceptable range.
The acceptable range is [0, 59].
Fields of Minute
value: u8Provided value.
Month field is out of the acceptable range.
The acceptable range is [1, 12].
Fields of Month
value: u8Provided value.
Second field is out of the acceptable range.
The acceptable range is [0, 59], or [0, 60] in the case of a leap second.
Fields of Second
value: u8Provided value.
Year field is out of the acceptable range.
The acceptable range is [2010, 2038].
Fields of Year
value: u16Provided value.
Trait Implementations
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Auto Trait Implementations
impl RefUnwindSafe for RangeField
impl Send for RangeField
impl Sync for RangeField
impl Unpin for RangeField
impl UnwindSafe for RangeField
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more