pub struct Date(_);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: i64) -> Self
pub fn from_timestamp(seconds_since_unix_epoch: i64) -> Self
Creates a new Date from seconds since (or before) the Unix epoch.
Trait Implementations§
source§impl CBORDecodable for Date
impl CBORDecodable for Date
source§fn from_cbor(cbor: &CBOR) -> Result<Box<Self>, DecodeError>
fn from_cbor(cbor: &CBOR) -> Result<Box<Self>, DecodeError>
Creates an instance of this type from CBOR symbolic representation.
source§fn from_cbor_data(cbor_data: &[u8]) -> Result<Box<Self>, DecodeError>
fn from_cbor_data(cbor_data: &[u8]) -> Result<Box<Self>, DecodeError>
Creates an instance of this type from encoded CBOR binary data.
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<Box<Self>, DecodeError>
fn from_untagged_cbor(cbor: &CBOR) -> Result<Box<Self>, DecodeError>
Creates an instance of this type by decoding it from untagged CBOR.
source§fn from_tagged_cbor(cbor: &CBOR) -> Result<Box<Self>, DecodeError>
fn from_tagged_cbor(cbor: &CBOR) -> Result<Box<Self>, DecodeError>
Creates an instance of this type by decoding it from tagged CBOR.
source§fn from_tagged_cbor_data(data: &[u8]) -> Result<Box<Self>, DecodeError>
fn from_tagged_cbor_data(data: &[u8]) -> Result<Box<Self>, DecodeError>
Creates an instance of this type by decoding it from binary encoded tagged CBOR.
source§fn from_untagged_cbor_data(data: &[u8]) -> Result<Box<Self>, DecodeError>
fn from_untagged_cbor_data(data: &[u8]) -> Result<Box<Self>, DecodeError>
Creates an instance of this type by decoding it from binary encoded untagged CBOR.