pub struct Date { /* private fields */ }
Expand description
It encodes the value using a number of seconds from the Gregorian calendar era using a Decimal
,
when combined with the time 00:00:00, and an optional timezone offset in minutes.
Implementations§
Source§impl Date
impl Date
pub const MAX: Date
pub const MIN: Date
pub fn new(timestamp: Timestamp) -> Date
pub fn from_be_bytes(bytes: [u8; 18]) -> Date
pub fn timestamp(&self) -> Timestamp
Sourcepub fn timezone(self) -> Option<DayTimeDuration>
pub fn timezone(self) -> Option<DayTimeDuration>
pub fn timezone_offset(self) -> Option<TimezoneOffset>
pub fn to_be_bytes(self) -> [u8; 18]
Sourcepub fn checked_sub(
self,
rhs: impl Into<Date>,
) -> Result<DayTimeDuration, ThinError>
pub fn checked_sub( self, rhs: impl Into<Date>, ) -> Result<DayTimeDuration, ThinError>
Returns Err
in case of overflow (FODT0001
).
Sourcepub fn checked_add_year_month_duration(
self,
rhs: impl Into<YearMonthDuration>,
) -> Result<Date, ThinError>
pub fn checked_add_year_month_duration( self, rhs: impl Into<YearMonthDuration>, ) -> Result<Date, ThinError>
op:add-yearMonthDuration-to-date
Returns Err
in case of overflow (FODT0001
).
Sourcepub fn checked_add_day_time_duration(
self,
rhs: impl Into<DayTimeDuration>,
) -> Result<Date, ThinError>
pub fn checked_add_day_time_duration( self, rhs: impl Into<DayTimeDuration>, ) -> Result<Date, ThinError>
op:add-dayTimeDuration-to-dateTime
Returns Err
in case of overflow (FODT0001
).
Sourcepub fn checked_add_duration(
self,
rhs: impl Into<Duration>,
) -> Result<Date, ThinError>
pub fn checked_add_duration( self, rhs: impl Into<Duration>, ) -> Result<Date, ThinError>
op:add-yearMonthDuration-to-date and op:add-dayTimeDuration-to-dateTime
Returns Err
in case of overflow (FODT0001
).
Sourcepub fn checked_sub_year_month_duration(
self,
rhs: impl Into<YearMonthDuration>,
) -> Result<Date, ThinError>
pub fn checked_sub_year_month_duration( self, rhs: impl Into<YearMonthDuration>, ) -> Result<Date, ThinError>
op:subtract-yearMonthDuration-from-date
Returns Err
in case of overflow (FODT0001
).
Sourcepub fn checked_sub_day_time_duration(
self,
rhs: impl Into<DayTimeDuration>,
) -> Result<Date, ThinError>
pub fn checked_sub_day_time_duration( self, rhs: impl Into<DayTimeDuration>, ) -> Result<Date, ThinError>
op:subtract-dayTimeDuration-from-date
Returns Err
in case of overflow (FODT0001
).
pub fn adjust( self, timezone_offset: Option<TimezoneOffset>, ) -> Result<Date, ThinError>
Sourcepub fn is_identical_with(self, other: Date) -> bool
pub fn is_identical_with(self, other: Date) -> bool
Checks if the two values are identical.
Trait Implementations§
Source§impl From<Date> for GYearMonth
Conversion according to XPath cast rules.
impl From<Date> for GYearMonth
Conversion according to XPath cast rules.
Source§fn from(date: Date) -> GYearMonth
fn from(date: Date) -> GYearMonth
Converts to this type from the input type.
Source§impl<'data> From<Date> for TypedValueRef<'data>
impl<'data> From<Date> for TypedValueRef<'data>
Source§fn from(value: Date) -> TypedValueRef<'data>
fn from(value: Date) -> TypedValueRef<'data>
Converts to this type from the input type.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more