pub struct Date(/* private fields */);Expand description
A CBOR-friendly representation of a date and time.
Implementations§
source§impl Date
impl Date
sourcepub fn from_datetime(date_time: DateTime<Utc>) -> Self
pub fn from_datetime(date_time: DateTime<Utc>) -> Self
Creates a new Date from the given chrono DateTime.
sourcepub fn from_timestamp(seconds_since_unix_epoch: f64) -> Self
pub fn from_timestamp(seconds_since_unix_epoch: f64) -> Self
Creates a new Date from seconds since (or before) the Unix epoch.
sourcepub fn new_from_string(value: &str) -> Result<Self>
pub fn new_from_string(value: &str) -> Result<Self>
Creates a new Date from a string containing an ISO-8601 (RFC-3339) date (with or without time).
Trait Implementations§
source§impl CBORDecodable for Date
impl CBORDecodable for Date
source§impl CBOREncodable for Date
impl CBOREncodable for Date
source§impl CBORTaggedDecodable for Date
impl CBORTaggedDecodable for Date
source§fn from_untagged_cbor(cbor: &CBOR) -> Result<Self>
fn from_untagged_cbor(cbor: &CBOR) -> Result<Self>
Creates an instance of this type by decoding it from untagged CBOR.
source§fn from_tagged_cbor(cbor: &CBOR) -> Result<Self>where
Self: Sized,
fn from_tagged_cbor(cbor: &CBOR) -> Result<Self>where Self: Sized,
Creates an instance of this type by decoding it from tagged CBOR.
source§impl CBORTaggedEncodable for Date
impl CBORTaggedEncodable for Date
source§fn untagged_cbor(&self) -> CBOR
fn untagged_cbor(&self) -> CBOR
Returns the untagged CBOR encoding of this instance.
source§fn tagged_cbor(&self) -> CBOR
fn tagged_cbor(&self) -> CBOR
Returns the tagged CBOR encoding of this instance.
source§fn tagged_cbor_data(&self) -> Vec<u8>
fn tagged_cbor_data(&self) -> Vec<u8>
Returns the tagged value in CBOR binary representation.
source§impl Ord for Date
impl Ord for Date
source§impl PartialEq for Date
impl PartialEq for Date
source§impl PartialOrd for Date
impl PartialOrd for Date
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 CBORCodable for Date
impl CBORTaggedCodable for Date
impl Eq for Date
impl StructuralEq for Date
impl StructuralPartialEq for Date
Auto Trait Implementations§
impl RefUnwindSafe for Date
impl Send for Date
impl Sync for Date
impl Unpin for Date
impl UnwindSafe for Date
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