Struct sqldatetime::OracleDate
source · [−]#[repr(transparent)]pub struct OracleDate(_);oracle only.Expand description
Oracle oriented Date type.
Implementations
sourceimpl Date
impl Date
sourcepub const MIN: Self = _
pub const MIN: Self = _
The smallest date that can be represented by Date, i.e. 0001-01-01 00:00:00.
sourcepub const MAX: Self = _
pub const MAX: Self = _
The largest date that can be represented by Date, i.e. 9999-12-31 23:59:59.
sourcepub const fn new(date: SqlDate, time: Time) -> Self
pub const fn new(date: SqlDate, time: Time) -> Self
Creates a new Oracle Date from a date and a time.
sourcepub const unsafe fn from_usecs_unchecked(usecs: i64) -> Self
pub const unsafe fn from_usecs_unchecked(usecs: i64) -> Self
Creates a Date from the given microseconds from Unix Epoch without checking validity.
Safety
This function is unsafe because the microsecond value is not checked for validity! Before using it, check that the value is correct.
sourcepub const fn try_from_usecs(usecs: i64) -> Result<Self, Error>
pub const fn try_from_usecs(usecs: i64) -> Result<Self, Error>
Creates a Date from the given microseconds from Unix Epoch
sourcepub fn format<S: AsRef<str>>(self, fmt: S) -> Result<impl Display, Error>
pub fn format<S: AsRef<str>>(self, fmt: S) -> Result<impl Display, Error>
Formats Date by given format string.
sourcepub fn parse<S1: AsRef<str>, S2: AsRef<str>>(
input: S1,
fmt: S2
) -> Result<Self, Error>
pub fn parse<S1: AsRef<str>, S2: AsRef<str>>(
input: S1,
fmt: S2
) -> Result<Self, Error>
Parses Date from given string and format.
sourcepub fn add_interval_dt(self, interval: IntervalDT) -> Result<Date, Error>
pub fn add_interval_dt(self, interval: IntervalDT) -> Result<Date, Error>
Date adds IntervalDT
sourcepub fn add_interval_ym(self, interval: IntervalYM) -> Result<Date, Error>
pub fn add_interval_ym(self, interval: IntervalYM) -> Result<Date, Error>
Date adds IntervalYM
sourcepub fn sub_timestamp(self, timestamp: Timestamp) -> IntervalDT
pub fn sub_timestamp(self, timestamp: Timestamp) -> IntervalDT
Date subtracts Timestamp
sourcepub fn sub_interval_dt(self, interval: IntervalDT) -> Result<Date, Error>
pub fn sub_interval_dt(self, interval: IntervalDT) -> Result<Date, Error>
Date subtracts IntervalDT
sourcepub fn sub_interval_ym(self, interval: IntervalYM) -> Result<Date, Error>
pub fn sub_interval_ym(self, interval: IntervalYM) -> Result<Date, Error>
Date subtracts IntervalYM
sourcepub fn last_day_of_month(self) -> Date
pub fn last_day_of_month(self) -> Date
Gets the last day in month of Date.
sourcepub fn months_between(self, date: Date) -> (i32, i64)
pub fn months_between(self, date: Date) -> (i32, i64)
Gets months and microseconds of datetime between two Date.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Date
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Date
serde only.sourcefn 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>,
sourceimpl Ord for Date
impl Ord for Date
1.21.0 · sourceconst fn max(self, other: Self) -> Self
const fn max(self, other: Self) -> Self
1.21.0 · sourceconst fn min(self, other: Self) -> Self
const fn min(self, other: Self) -> Self
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
sourceimpl PartialOrd<Date> for Date
impl PartialOrd<Date> for Date
sourcefn partial_cmp(&self, other: &Date) -> Option<Ordering>
fn partial_cmp(&self, other: &Date) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresourceimpl PartialOrd<Date> for Date
impl PartialOrd<Date> for Date
sourcefn partial_cmp(&self, other: &SqlDate) -> Option<Ordering>
fn partial_cmp(&self, other: &SqlDate) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresourceimpl PartialOrd<Date> for SqlDate
impl PartialOrd<Date> for SqlDate
sourcefn partial_cmp(&self, other: &Date) -> Option<Ordering>
fn partial_cmp(&self, other: &Date) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresourceimpl PartialOrd<Date> for Timestamp
impl PartialOrd<Date> for Timestamp
sourcefn partial_cmp(&self, other: &Date) -> Option<Ordering>
fn partial_cmp(&self, other: &Date) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moresourceimpl PartialOrd<Timestamp> for Date
impl PartialOrd<Timestamp> for Date
sourcefn partial_cmp(&self, other: &Timestamp) -> Option<Ordering>
fn partial_cmp(&self, other: &Timestamp) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read more