[−][src]Struct pgdatetime::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]
s: &str,
date_order: DateOrder
) -> Result<Self, DateTimeError>
Parses Date
string.
pub fn format(
self,
date_style: DateStyle,
date_order: DateOrder
) -> Result<String, DateTimeError>
[src]
self,
date_style: DateStyle,
date_order: DateOrder
) -> Result<String, DateTimeError>
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]
&self,
ty: FieldType,
unit: DateUnit
) -> Result<Option<f64>, DateTimeError>
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.
fn is_infinite(&self) -> bool
[src]
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]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Date
[src]
fn cmp(&self, other: &Date) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Date> for Date
[src]
impl PartialOrd<Date> for Date
[src]
fn partial_cmp(&self, other: &Date) -> Option<Ordering>
[src]
fn lt(&self, other: &Date) -> bool
[src]
fn le(&self, other: &Date) -> bool
[src]
fn gt(&self, other: &Date) -> bool
[src]
fn ge(&self, other: &Date) -> bool
[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.
fn try_from(value: Date) -> Result<Self, Self::Error>
[src]
impl TryFrom<Timestamp> for Date
[src]
Converts timestamp
to 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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,