#[repr(transparent)]pub struct Date(_);Expand description
A date is stored as a 64-bit integer amount of “ticks” since 00:00:00 UTC on January 1 of year 1 A.D. in the Gregorian calendar, where a “tick” is 100 nanoseconds.
The top two bits of this value are ignored by Bebop. In .NET, they are used to specify whether a date is in UTC or local to the current time zone. But in Bebop, all date-times on the wire are in UTC.
Implementations
sourceimpl Date
impl Date
pub const fn from_ticks(t: u64) -> Self
pub const fn from_ticks_since_unix_epoch(t: u64) -> Self
pub const fn to_ticks(self) -> u64
pub const fn to_ticks_since_unix_epoch(self) -> u64
pub const fn from_micros(t: u64) -> Self
pub const fn from_micros_since_unix_epoch(t: u64) -> Self
pub const fn to_micros(self) -> u64
pub const fn to_micros_since_unix_epoch(self) -> u64
pub const fn from_millis(t: u64) -> Self
pub const fn from_millis_since_unix_epoch(t: u64) -> Self
pub const fn to_millis(self) -> u64
pub const fn to_millis_since_unix_epoch(self) -> u64
pub const fn from_secs(t: u64) -> Self
pub const fn from_secs_since_unix_epoch(t: u64) -> Self
pub const fn to_secs(self) -> u64
pub const fn to_secs_since_unix_epoch(self) -> u64
pub fn to_micros_f(self) -> f64
pub fn to_micros_since_unix_epoch_f(self) -> f64
pub fn to_millis_f(self) -> f64
pub fn to_millis_since_unix_epoch_f(self) -> f64
pub fn to_secs_f(self) -> f64
pub fn to_secs_since_unix_epoch_f(self) -> f64
Trait Implementations
sourceimpl FixedSized for Date
impl FixedSized for Date
const SERIALIZED_SIZE: usize = _
sourceimpl Ord for Date
impl Ord for Date
sourceimpl PartialOrd<Date> for Date
impl PartialOrd<Date> for Date
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl<'raw> SubRecord<'raw> for Date
impl<'raw> SubRecord<'raw> for Date
const MIN_SERIALIZED_SIZE: usize = 8usize
const EXACT_SERIALIZED_SIZE: Option<usize> = _
sourcefn serialized_size(&self) -> usize
fn serialized_size(&self) -> usize
Exact size this will be once serialized in bytes. Read more
impl Copy for Date
impl Eq 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more