#[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§
source§impl 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§
source§impl FixedSized for Date
impl FixedSized for Date
const SERIALIZED_SIZE: usize = _
source§impl Ord for Date
impl Ord for Date
source§impl PartialEq<Date> for Date
impl PartialEq<Date> for Date
source§impl PartialOrd<Date> for Date
impl PartialOrd<Date> 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 moresource§impl<'raw> SubRecord<'raw> for Date
impl<'raw> SubRecord<'raw> for Date
const MIN_SERIALIZED_SIZE: usize = 8usize
const EXACT_SERIALIZED_SIZE: Option<usize> = _
source§fn serialized_size(&self) -> usize
fn serialized_size(&self) -> usize
Exact size this will be once serialized in bytes. Read more
source§fn _serialize_chained<W: Write>(&self, dest: &mut W) -> SeResult<usize>
fn _serialize_chained<W: Write>(&self, dest: &mut W) -> SeResult<usize>
Should only be called from generated code!
Serialize this record. It is highly recommend to use a buffered writer.
source§unsafe fn _serialize_chained_unaligned<W: Write>(
zelf: *const Self,
dest: &mut W
) -> SeResult<usize>
unsafe fn _serialize_chained_unaligned<W: Write>( zelf: *const Self, dest: &mut W ) -> SeResult<usize>
Should only be called from generated code!
Serialize this record. It is highly recommend to use a buffered writer. 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§
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