pub struct Timestamp(/* private fields */);Expand description
Date and time with binary encoding support.
Implementations§
source§impl Timestamp
impl Timestamp
sourcepub fn from_calendar_date(year: i32, month: Month, day: u8) -> Result<Self>
pub fn from_calendar_date(year: i32, month: Month, day: u8) -> Result<Self>
Create from a calendar date.
sourcepub fn parse_simple_date(s: &str) -> Result<Self>
pub fn parse_simple_date(s: &str) -> Result<Self>
Parse from a simple date format YYYY-MM-DD.
sourcepub fn format_simple_date(&self) -> Result<String>
pub fn format_simple_date(&self) -> Result<String>
Format as a simple date YYYY-MM-DD.
sourcepub fn parse_rfc3339(value: &str) -> Result<Self>
pub fn parse_rfc3339(value: &str) -> Result<Self>
Parse as RFC3339.
sourcepub fn to_date_time(&self) -> Result<String>
pub fn to_date_time(&self) -> Result<String>
Convert to a short human-readable date and time without the timezone offset.
sourcepub fn to_rfc2822(&self) -> Result<String>
pub fn to_rfc2822(&self) -> Result<String>
Convert this timestamp to a RFC2822 formatted string.
sourcepub fn to_rfc3339(&self) -> Result<String>
pub fn to_rfc3339(&self) -> Result<String>
Convert this timestamp to a RFC3339 formatted string.
sourcepub fn rfc3339(datetime: &OffsetDateTime) -> Result<String>
pub fn rfc3339(datetime: &OffsetDateTime) -> Result<String>
Convert an offset date time to a RFC3339 formatted string.
Trait Implementations§
source§impl Decodable for Timestamp
impl Decodable for Timestamp
source§impl<'de> Deserialize<'de> for Timestamp
impl<'de> Deserialize<'de> for Timestamp
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Encodable for Timestamp
impl Encodable for Timestamp
source§impl From<OffsetDateTime> for Timestamp
impl From<OffsetDateTime> for Timestamp
source§fn from(value: OffsetDateTime) -> Self
fn from(value: OffsetDateTime) -> Self
Converts to this type from the input type.
source§impl From<Timestamp> for OffsetDateTime
impl From<Timestamp> for OffsetDateTime
source§impl Ord for Timestamp
impl Ord for Timestamp
source§impl PartialEq for Timestamp
impl PartialEq for Timestamp
source§impl PartialOrd for Timestamp
impl PartialOrd for Timestamp
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Eq for Timestamp
impl StructuralEq for Timestamp
impl StructuralPartialEq for Timestamp
Auto Trait Implementations§
impl RefUnwindSafe for Timestamp
impl Send for Timestamp
impl Sync for Timestamp
impl Unpin for Timestamp
impl UnwindSafe for Timestamp
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§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.