pub struct Datetime(/* private fields */);Expand description
A validated AT Protocol datetime string.
Format: YYYY-MM-DDTHH:mm:ss(.fractional)?(Z|±HH:mm)
Implementations§
Source§impl Datetime
impl Datetime
Sourcepub fn new(s: &str) -> Result<Self, InvalidDatetimeError>
pub fn new(s: &str) -> Result<Self, InvalidDatetimeError>
Create a new Datetime from a string, validating the format.
Sourcepub fn into_inner(self) -> String
pub fn into_inner(self) -> String
Consume and return the inner string.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Datetime
impl<'de> Deserialize<'de> for Datetime
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Datetime
impl Ord for Datetime
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Datetime
impl PartialOrd for Datetime
impl Eq for Datetime
impl StructuralPartialEq for Datetime
Auto Trait Implementations§
impl Freeze for Datetime
impl RefUnwindSafe for Datetime
impl Send for Datetime
impl Sync for Datetime
impl Unpin for Datetime
impl UnsafeUnpin for Datetime
impl UnwindSafe for Datetime
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