pub enum DatetimeError {
Malformed(&'static str),
MissingTimezone,
NegativeZeroOffset,
OutOfRange {
field: &'static str,
value: u32,
},
NoSuchDay {
year: u32,
month: u32,
day: u32,
},
BeforeEpoch,
}Expand description
Why a string is not a valid atproto datetime.
Variants§
Malformed(&'static str)
The overall shape is wrong: a field of the wrong width, a separator that is not the one required, or a missing component.
MissingTimezone
The timezone designator is absent, which atproto requires.
NegativeZeroOffset
-00:00, which RFC 3339 defines as “offset unknown” and ISO 8601 does
not permit at all.
OutOfRange
A field is syntactically fine and outside its range: month thirteen, hour twenty-five, day zero.
NoSuchDay
A day that does not exist in that month of that year.
BeforeEpoch
The offset moves the instant before 0000-01-01T00:00:00Z.
0000-01-01T00:00:00+01:00 is well formed and normalizes to an hour
before the earliest representable instant, so it names no time at all.
Trait Implementations§
Source§impl Clone for DatetimeError
impl Clone for DatetimeError
Source§fn clone(&self) -> DatetimeError
fn clone(&self) -> DatetimeError
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 DatetimeError
impl Debug for DatetimeError
Source§impl Display for DatetimeError
impl Display for DatetimeError
Source§impl Error for DatetimeError
impl Error for DatetimeError
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 DatetimeError
impl PartialEq for DatetimeError
Source§fn eq(&self, other: &DatetimeError) -> bool
fn eq(&self, other: &DatetimeError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for DatetimeError
impl StructuralPartialEq for DatetimeError
Auto Trait Implementations§
impl Freeze for DatetimeError
impl RefUnwindSafe for DatetimeError
impl Send for DatetimeError
impl Sync for DatetimeError
impl Unpin for DatetimeError
impl UnsafeUnpin for DatetimeError
impl UnwindSafe for DatetimeError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.