pub struct Date(/* private fields */);
Expand description
A date in utc
Implementations§
Source§impl Date
impl Date
pub fn now() -> Self
pub fn raw(&self) -> &NaiveDate
pub fn raw_mut(&mut self) -> &mut NaiveDate
pub fn to_datetime(&self) -> DateTime
pub fn to_days_since_1970(&self) -> i32
pub fn from_days_since_1970(days: i32) -> Self
pub fn try_sub(&self, other: &Date) -> Option<StdDuration>
pub fn into_raw(self) -> NaiveDate
Trait Implementations§
Source§impl ColumnType for Date
impl ColumnType for Date
fn column_kind() -> ColumnKind
fn to_data(&self) -> ColumnData<'_>
fn from_data(data: ColumnData<'_>) -> Result<Self, FromDataError>
Source§impl<'de> Deserialize<'de> for Date
impl<'de> Deserialize<'de> for Date
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Date
impl Ord for Date
Source§impl PartialOrd for Date
impl PartialOrd for Date
impl Copy for Date
impl Eq for Date
impl StructuralPartialEq 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