[][src]Struct pgdatetime::Date

#[repr(transparent)]pub struct Date(_);

Date (no time of day).

Implementations

impl Date[src]

pub fn try_from_ymd(y: i32, m: i32, d: i32) -> Result<Self, DateTimeError>[src]

Constructs Date from year, month and day.

pub fn add_days(self, days: i32) -> Result<Self, DateTimeError>[src]

Date adds days.

pub fn add_interval(self, span: Interval) -> Result<Timestamp, DateTimeError>[src]

Date add Interval.

pub fn add_time(self, time: Time) -> Result<Timestamp, DateTimeError>[src]

Date adds Time.

pub fn sub_date(self, date: Date) -> Result<i32, DateTimeError>[src]

Date subtracts Date.

pub fn sub_days(self, days: i32) -> Result<Date, DateTimeError>[src]

Date subtracts days.

pub fn sub_interval(self, span: Interval) -> Result<Timestamp, DateTimeError>[src]

Date subtracts Interval.

pub fn try_from_str(
    s: &str,
    date_order: DateOrder
) -> Result<Self, DateTimeError>
[src]

Parses Date string.

pub fn format(
    self,
    date_style: DateStyle,
    date_order: DateOrder
) -> Result<String, DateTimeError>
[src]

Convert Date to string.

Trait Implementations

impl Clone for Date[src]

impl Copy for Date[src]

impl DateTime for Date[src]

fn date_part(
    &self,
    ty: FieldType,
    unit: DateUnit
) -> Result<Option<f64>, DateTimeError>
[src]

Extracts specified field from Date.

fn is_finite(&self) -> bool[src]

Checks whether Date is finite.

fn truncate(&self, ty: FieldType, unit: DateUnit) -> Result<Self, DateTimeError>[src]

Truncates Date to specified units.

impl Debug for Date[src]

impl Eq for Date[src]

impl From<Date> for i32[src]

Converts Date to i32 type.

impl From<i32> for Date[src]

Converts i32 to Date type.

impl Hash for Date[src]

impl Ord for Date[src]

impl PartialEq<Date> for Date[src]

impl PartialOrd<Date> for Date[src]

impl StructuralEq for Date[src]

impl StructuralPartialEq for Date[src]

impl TryFrom<Date> for Timestamp[src]

Converts Date to Timestamp.

type Error = DateTimeError

The type returned in the event of a conversion error.

impl TryFrom<Timestamp> for Date[src]

Converts timestamp to date.

type Error = DateTimeError

The type returned in the event of a conversion error.

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.