pub enum InvalidTime {
HoursOutOfRange(u8),
MinutesOutOfRange(u8),
SecondsOutOfRange(u8),
}Expand description
Indicates and attempt to create an invalid Time.
use leap_seconds::{Time, InvalidTime};
// A time with 60 seconds is invalid
let error = Time::new(18, 42, 60);
assert_eq!(error, Err(InvalidTime::SecondsOutOfRange(60)));Variants§
HoursOutOfRange(u8)
Indicates that the hours were out of range.
MinutesOutOfRange(u8)
Indicates that the minutes were out of range.
SecondsOutOfRange(u8)
Indicates that the seconds were out of range.
Trait Implementations§
Source§impl Clone for InvalidTime
impl Clone for InvalidTime
Source§fn clone(&self) -> InvalidTime
fn clone(&self) -> InvalidTime
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InvalidTime
impl Debug for InvalidTime
Source§impl Display for InvalidTime
impl Display for InvalidTime
Source§impl Error for InvalidTime
impl Error for InvalidTime
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for InvalidTime
impl PartialEq for InvalidTime
Source§fn eq(&self, other: &InvalidTime) -> bool
fn eq(&self, other: &InvalidTime) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for InvalidTime
impl Eq for InvalidTime
impl StructuralPartialEq for InvalidTime
Auto Trait Implementations§
impl Freeze for InvalidTime
impl RefUnwindSafe for InvalidTime
impl Send for InvalidTime
impl Sync for InvalidTime
impl Unpin for InvalidTime
impl UnsafeUnpin for InvalidTime
impl UnwindSafe for InvalidTime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more