pub struct Date(/* private fields */);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 PartialOrd for Date
impl PartialOrd for Date
Source§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.
impl Copy for Date
impl Eq for Date
Auto Trait Implementations§
impl Freeze for Date
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