Struct fire_postgres::time::Date
source · 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_utc_datetime(&self) -> DateTime
👎Deprecated: use to_datetime instead
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 PartialEq for Date
impl PartialEq for Date
source§impl PartialOrd for Date
impl PartialOrd 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 moreimpl Copy for Date
impl Eq for Date
impl StructuralEq for Date
impl StructuralPartialEq 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