@ -60,53 +60,53 @@ impl DateTime {
/// [fn:year-from-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-year-from-dateTime)
/// [fn:year-from-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-year-from-dateTime)
#[ inline ]
#[ inline ]
pub fn year ( & self ) -> i64 {
pub fn year ( self ) -> i64 {
self . timestamp . year ( )
self . timestamp . year ( )
}
}
/// [fn:month-from-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-month-from-dateTime)
/// [fn:month-from-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-month-from-dateTime)
#[ inline ]
#[ inline ]
pub fn month ( & self ) -> u8 {
pub fn month ( self ) -> u8 {
self . timestamp . month ( )
self . timestamp . month ( )
}
}
/// [fn:day-from-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-day-from-dateTime)
/// [fn:day-from-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-day-from-dateTime)
#[ inline ]
#[ inline ]
pub fn day ( & self ) -> u8 {
pub fn day ( self ) -> u8 {
self . timestamp . day ( )
self . timestamp . day ( )
}
}
/// [fn:hour-from-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-hours-from-dateTime)
/// [fn:hour-from-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-hours-from-dateTime)
#[ inline ]
#[ inline ]
pub fn hour ( & self ) -> u8 {
pub fn hour ( self ) -> u8 {
self . timestamp . hour ( )
self . timestamp . hour ( )
}
}
/// [fn:minute-from-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-minutes-from-dateTime)
/// [fn:minute-from-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-minutes-from-dateTime)
#[ inline ]
#[ inline ]
pub fn minute ( & self ) -> u8 {
pub fn minute ( self ) -> u8 {
self . timestamp . minute ( )
self . timestamp . minute ( )
}
}
/// [fn:second-from-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-seconds-from-dateTime)
/// [fn:second-from-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-seconds-from-dateTime)
#[ inline ]
#[ inline ]
pub fn second ( & self ) -> Decimal {
pub fn second ( self ) -> Decimal {
self . timestamp . second ( )
self . timestamp . second ( )
}
}
/// [fn:timezone-from-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-timezone-from-dateTime)
/// [fn:timezone-from-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-timezone-from-dateTime)
#[ inline ]
#[ inline ]
pub fn timezone ( & self ) -> Option < DayTimeDuration > {
pub fn timezone ( self ) -> Option < DayTimeDuration > {
Some ( self . timezone_offset ( ) ? . into ( ) )
Some ( self . timezone_offset ( ) ? . into ( ) )
}
}
#[ inline ]
#[ inline ]
pub fn timezone_offset ( & self ) -> Option < TimezoneOffset > {
pub fn timezone_offset ( self ) -> Option < TimezoneOffset > {
self . timestamp . timezone_offset ( )
self . timestamp . timezone_offset ( )
}
}
#[ inline ]
#[ inline ]
fn properties ( & self ) -> DateTimeSevenPropertyModel {
fn properties ( self ) -> DateTimeSevenPropertyModel {
DateTimeSevenPropertyModel {
DateTimeSevenPropertyModel {
year : Some ( self . year ( ) ) ,
year : Some ( self . year ( ) ) ,
month : Some ( self . month ( ) ) ,
month : Some ( self . month ( ) ) ,
@ -125,14 +125,14 @@ impl DateTime {
/// [op:subtract-dateTimes](https://www.w3.org/TR/xpath-functions-31/#func-subtract-dateTimes)
/// [op:subtract-dateTimes](https://www.w3.org/TR/xpath-functions-31/#func-subtract-dateTimes)
#[ inline ]
#[ inline ]
pub fn checked_sub ( & self , rhs : impl Into < Self > ) -> Option < DayTimeDuration > {
pub fn checked_sub ( self , rhs : impl Into < Self > ) -> Option < DayTimeDuration > {
self . timestamp . checked_sub ( rhs . into ( ) . timestamp )
self . timestamp . checked_sub ( rhs . into ( ) . timestamp )
}
}
/// [op:add-yearMonthDuration-to-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-add-yearMonthDuration-to-dateTime)
/// [op:add-yearMonthDuration-to-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-add-yearMonthDuration-to-dateTime)
#[ inline ]
#[ inline ]
pub fn checked_add_year_month_duration (
pub fn checked_add_year_month_duration (
& self ,
self ,
rhs : impl Into < YearMonthDuration > ,
rhs : impl Into < YearMonthDuration > ,
) -> Option < Self > {
) -> Option < Self > {
self . checked_add_duration ( Duration ::from ( rhs . into ( ) ) )
self . checked_add_duration ( Duration ::from ( rhs . into ( ) ) )
@ -140,7 +140,7 @@ impl DateTime {
/// [op:add-dayTimeDuration-to-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-add-dayTimeDuration-to-dateTime)
/// [op:add-dayTimeDuration-to-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-add-dayTimeDuration-to-dateTime)
#[ inline ]
#[ inline ]
pub fn checked_add_day_time_duration ( & self , rhs : impl Into < Duration > ) -> Option < Self > {
pub fn checked_add_day_time_duration ( self , rhs : impl Into < Duration > ) -> Option < Self > {
let rhs = rhs . into ( ) ;
let rhs = rhs . into ( ) ;
Some ( Self {
Some ( Self {
timestamp : self . timestamp . checked_add_seconds ( rhs . all_seconds ( ) ) ? ,
timestamp : self . timestamp . checked_add_seconds ( rhs . all_seconds ( ) ) ? ,
@ -149,7 +149,7 @@ impl DateTime {
/// [op:add-yearMonthDuration-to-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-add-yearMonthDuration-to-dateTime) and [op:add-dayTimeDuration-to-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-add-dayTimeDuration-to-dateTime)
/// [op:add-yearMonthDuration-to-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-add-yearMonthDuration-to-dateTime) and [op:add-dayTimeDuration-to-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-add-dayTimeDuration-to-dateTime)
#[ inline ]
#[ inline ]
pub fn checked_add_duration ( & self , rhs : impl Into < Duration > ) -> Option < Self > {
pub fn checked_add_duration ( self , rhs : impl Into < Duration > ) -> Option < Self > {
let rhs = rhs . into ( ) ;
let rhs = rhs . into ( ) ;
if let Ok ( rhs ) = DayTimeDuration ::try_from ( rhs ) {
if let Ok ( rhs ) = DayTimeDuration ::try_from ( rhs ) {
self . checked_add_day_time_duration ( rhs )
self . checked_add_day_time_duration ( rhs )
@ -164,7 +164,7 @@ impl DateTime {
/// [op:subtract-yearMonthDuration-from-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-subtract-yearMonthDuration-from-dateTime)
/// [op:subtract-yearMonthDuration-from-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-subtract-yearMonthDuration-from-dateTime)
#[ inline ]
#[ inline ]
pub fn checked_sub_year_month_duration (
pub fn checked_sub_year_month_duration (
& self ,
self ,
rhs : impl Into < YearMonthDuration > ,
rhs : impl Into < YearMonthDuration > ,
) -> Option < Self > {
) -> Option < Self > {
self . checked_sub_duration ( Duration ::from ( rhs . into ( ) ) )
self . checked_sub_duration ( Duration ::from ( rhs . into ( ) ) )
@ -172,7 +172,7 @@ impl DateTime {
/// [op:subtract-dayTimeDuration-from-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-subtract-dayTimeDuration-from-dateTime)
/// [op:subtract-dayTimeDuration-from-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-subtract-dayTimeDuration-from-dateTime)
#[ inline ]
#[ inline ]
pub fn checked_sub_day_time_duration ( & self , rhs : impl Into < DayTimeDuration > ) -> Option < Self > {
pub fn checked_sub_day_time_duration ( self , rhs : impl Into < DayTimeDuration > ) -> Option < Self > {
let rhs = rhs . into ( ) ;
let rhs = rhs . into ( ) ;
Some ( Self {
Some ( Self {
timestamp : self . timestamp . checked_sub_seconds ( rhs . all_seconds ( ) ) ? ,
timestamp : self . timestamp . checked_sub_seconds ( rhs . all_seconds ( ) ) ? ,
@ -181,7 +181,7 @@ impl DateTime {
/// [op:subtract-yearMonthDuration-from-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-subtract-yearMonthDuration-from-dateTime) and [op:subtract-dayTimeDuration-from-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-subtract-dayTimeDuration-from-dateTime)
/// [op:subtract-yearMonthDuration-from-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-subtract-yearMonthDuration-from-dateTime) and [op:subtract-dayTimeDuration-from-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-subtract-dayTimeDuration-from-dateTime)
#[ inline ]
#[ inline ]
pub fn checked_sub_duration ( & self , rhs : impl Into < Duration > ) -> Option < Self > {
pub fn checked_sub_duration ( self , rhs : impl Into < Duration > ) -> Option < Self > {
let rhs = rhs . into ( ) ;
let rhs = rhs . into ( ) ;
if let Ok ( rhs ) = DayTimeDuration ::try_from ( rhs ) {
if let Ok ( rhs ) = DayTimeDuration ::try_from ( rhs ) {
self . checked_sub_day_time_duration ( rhs )
self . checked_sub_day_time_duration ( rhs )
@ -198,7 +198,7 @@ impl DateTime {
/// [fn:adjust-dateTime-to-timezone](https://www.w3.org/TR/xpath-functions-31/#func-adjust-dateTime-to-timezone)
/// [fn:adjust-dateTime-to-timezone](https://www.w3.org/TR/xpath-functions-31/#func-adjust-dateTime-to-timezone)
#[ inline ]
#[ inline ]
pub fn adjust ( & self , timezone_offset : Option < TimezoneOffset > ) -> Option < Self > {
pub fn adjust ( self , timezone_offset : Option < TimezoneOffset > ) -> Option < Self > {
Some ( Self {
Some ( Self {
timestamp : self . timestamp . adjust ( timezone_offset ) ? ,
timestamp : self . timestamp . adjust ( timezone_offset ) ? ,
} )
} )
@ -206,8 +206,8 @@ impl DateTime {
/// Checks if the two values are [identical](https://www.w3.org/TR/xmlschema11-2/#identity).
/// Checks if the two values are [identical](https://www.w3.org/TR/xmlschema11-2/#identity).
#[ inline ]
#[ inline ]
pub fn is_identical_with ( & self , other : & Self ) -> bool {
pub fn is_identical_with ( self , other : Self ) -> bool {
self . timestamp . is_identical_with ( & other . timestamp )
self . timestamp . is_identical_with ( other . timestamp )
}
}
}
}
@ -314,30 +314,30 @@ impl Time {
/// [fn:hour-from-time](https://www.w3.org/TR/xpath-functions-31/#func-hours-from-time)
/// [fn:hour-from-time](https://www.w3.org/TR/xpath-functions-31/#func-hours-from-time)
#[ inline ]
#[ inline ]
pub fn hour ( & self ) -> u8 {
pub fn hour ( self ) -> u8 {
self . timestamp . hour ( )
self . timestamp . hour ( )
}
}
/// [fn:minute-from-time](https://www.w3.org/TR/xpath-functions-31/#func-minutes-from-time)
/// [fn:minute-from-time](https://www.w3.org/TR/xpath-functions-31/#func-minutes-from-time)
#[ inline ]
#[ inline ]
pub fn minute ( & self ) -> u8 {
pub fn minute ( self ) -> u8 {
self . timestamp . minute ( )
self . timestamp . minute ( )
}
}
/// [fn:second-from-time](https://www.w3.org/TR/xpath-functions-31/#func-seconds-from-time)
/// [fn:second-from-time](https://www.w3.org/TR/xpath-functions-31/#func-seconds-from-time)
#[ inline ]
#[ inline ]
pub fn second ( & self ) -> Decimal {
pub fn second ( self ) -> Decimal {
self . timestamp . second ( )
self . timestamp . second ( )
}
}
/// [fn:timezone-from-time](https://www.w3.org/TR/xpath-functions-31/#func-timezone-from-time)
/// [fn:timezone-from-time](https://www.w3.org/TR/xpath-functions-31/#func-timezone-from-time)
#[ inline ]
#[ inline ]
pub fn timezone ( & self ) -> Option < DayTimeDuration > {
pub fn timezone ( self ) -> Option < DayTimeDuration > {
Some ( self . timezone_offset ( ) ? . into ( ) )
Some ( self . timezone_offset ( ) ? . into ( ) )
}
}
#[ inline ]
#[ inline ]
pub fn timezone_offset ( & self ) -> Option < TimezoneOffset > {
pub fn timezone_offset ( self ) -> Option < TimezoneOffset > {
self . timestamp . timezone_offset ( )
self . timestamp . timezone_offset ( )
}
}
@ -348,19 +348,19 @@ impl Time {
/// [op:subtract-times](https://www.w3.org/TR/xpath-functions-31/#func-subtract-times)
/// [op:subtract-times](https://www.w3.org/TR/xpath-functions-31/#func-subtract-times)
#[ inline ]
#[ inline ]
pub fn checked_sub ( & self , rhs : impl Into < Self > ) -> Option < DayTimeDuration > {
pub fn checked_sub ( self , rhs : impl Into < Self > ) -> Option < DayTimeDuration > {
self . timestamp . checked_sub ( rhs . into ( ) . timestamp )
self . timestamp . checked_sub ( rhs . into ( ) . timestamp )
}
}
/// [op:add-dayTimeDuration-to-time](https://www.w3.org/TR/xpath-functions-31/#func-add-dayTimeDuration-to-time)
/// [op:add-dayTimeDuration-to-time](https://www.w3.org/TR/xpath-functions-31/#func-add-dayTimeDuration-to-time)
#[ inline ]
#[ inline ]
pub fn checked_add_day_time_duration ( & self , rhs : impl Into < DayTimeDuration > ) -> Option < Self > {
pub fn checked_add_day_time_duration ( self , rhs : impl Into < DayTimeDuration > ) -> Option < Self > {
self . checked_add_duration ( Duration ::from ( rhs . into ( ) ) )
self . checked_add_duration ( Duration ::from ( rhs . into ( ) ) )
}
}
/// [op:add-dayTimeDuration-to-time](https://www.w3.org/TR/xpath-functions-31/#func-add-dayTimeDuration-to-time)
/// [op:add-dayTimeDuration-to-time](https://www.w3.org/TR/xpath-functions-31/#func-add-dayTimeDuration-to-time)
#[ inline ]
#[ inline ]
pub fn checked_add_duration ( & self , rhs : impl Into < Duration > ) -> Option < Self > {
pub fn checked_add_duration ( self , rhs : impl Into < Duration > ) -> Option < Self > {
DateTime ::new (
DateTime ::new (
1972 ,
1972 ,
12 ,
12 ,
@ -378,13 +378,13 @@ impl Time {
/// [op:subtract-dayTimeDuration-from-time](https://www.w3.org/TR/xpath-functions-31/#func-subtract-dayTimeDuration-from-time)
/// [op:subtract-dayTimeDuration-from-time](https://www.w3.org/TR/xpath-functions-31/#func-subtract-dayTimeDuration-from-time)
#[ inline ]
#[ inline ]
pub fn checked_sub_day_time_duration ( & self , rhs : impl Into < DayTimeDuration > ) -> Option < Self > {
pub fn checked_sub_day_time_duration ( self , rhs : impl Into < DayTimeDuration > ) -> Option < Self > {
self . checked_sub_duration ( Duration ::from ( rhs . into ( ) ) )
self . checked_sub_duration ( Duration ::from ( rhs . into ( ) ) )
}
}
/// [op:subtract-dayTimeDuration-from-time](https://www.w3.org/TR/xpath-functions-31/#func-subtract-dayTimeDuration-from-time)
/// [op:subtract-dayTimeDuration-from-time](https://www.w3.org/TR/xpath-functions-31/#func-subtract-dayTimeDuration-from-time)
#[ inline ]
#[ inline ]
pub fn checked_sub_duration ( & self , rhs : impl Into < Duration > ) -> Option < Self > {
pub fn checked_sub_duration ( self , rhs : impl Into < Duration > ) -> Option < Self > {
DateTime ::new (
DateTime ::new (
1972 ,
1972 ,
12 ,
12 ,
@ -402,7 +402,7 @@ impl Time {
// [fn:adjust-time-to-timezone](https://www.w3.org/TR/xpath-functions-31/#func-adjust-time-to-timezone)
// [fn:adjust-time-to-timezone](https://www.w3.org/TR/xpath-functions-31/#func-adjust-time-to-timezone)
#[ inline ]
#[ inline ]
pub fn adjust ( & self , timezone_offset : Option < TimezoneOffset > ) -> Option < Self > {
pub fn adjust ( self , timezone_offset : Option < TimezoneOffset > ) -> Option < Self > {
DateTime ::new (
DateTime ::new (
1972 ,
1972 ,
12 ,
12 ,
@ -420,8 +420,8 @@ impl Time {
/// Checks if the two values are [identical](https://www.w3.org/TR/xmlschema11-2/#identity).
/// Checks if the two values are [identical](https://www.w3.org/TR/xmlschema11-2/#identity).
#[ inline ]
#[ inline ]
pub fn is_identical_with ( & self , other : & Self ) -> bool {
pub fn is_identical_with ( self , other : Self ) -> bool {
self . timestamp . is_identical_with ( & other . timestamp )
self . timestamp . is_identical_with ( other . timestamp )
}
}
}
}
@ -515,30 +515,30 @@ impl Date {
/// [fn:year-from-date](https://www.w3.org/TR/xpath-functions-31/#func-year-from-date)
/// [fn:year-from-date](https://www.w3.org/TR/xpath-functions-31/#func-year-from-date)
#[ inline ]
#[ inline ]
pub fn year ( & self ) -> i64 {
pub fn year ( self ) -> i64 {
self . timestamp . year ( )
self . timestamp . year ( )
}
}
/// [fn:month-from-date](https://www.w3.org/TR/xpath-functions-31/#func-month-from-date)
/// [fn:month-from-date](https://www.w3.org/TR/xpath-functions-31/#func-month-from-date)
#[ inline ]
#[ inline ]
pub fn month ( & self ) -> u8 {
pub fn month ( self ) -> u8 {
self . timestamp . month ( )
self . timestamp . month ( )
}
}
/// [fn:day-from-date](https://www.w3.org/TR/xpath-functions-31/#func-day-from-date)
/// [fn:day-from-date](https://www.w3.org/TR/xpath-functions-31/#func-day-from-date)
#[ inline ]
#[ inline ]
pub fn day ( & self ) -> u8 {
pub fn day ( self ) -> u8 {
self . timestamp . day ( )
self . timestamp . day ( )
}
}
/// [fn:timezone-from-date](https://www.w3.org/TR/xpath-functions-31/#func-timezone-from-date)
/// [fn:timezone-from-date](https://www.w3.org/TR/xpath-functions-31/#func-timezone-from-date)
#[ inline ]
#[ inline ]
pub fn timezone ( & self ) -> Option < DayTimeDuration > {
pub fn timezone ( self ) -> Option < DayTimeDuration > {
Some ( self . timezone_offset ( ) ? . into ( ) )
Some ( self . timezone_offset ( ) ? . into ( ) )
}
}
#[ inline ]
#[ inline ]
pub fn timezone_offset ( & self ) -> Option < TimezoneOffset > {
pub fn timezone_offset ( self ) -> Option < TimezoneOffset > {
self . timestamp . timezone_offset ( )
self . timestamp . timezone_offset ( )
}
}
@ -549,14 +549,14 @@ impl Date {
/// [op:subtract-dates](https://www.w3.org/TR/xpath-functions-31/#func-subtract-dates)
/// [op:subtract-dates](https://www.w3.org/TR/xpath-functions-31/#func-subtract-dates)
#[ inline ]
#[ inline ]
pub fn checked_sub ( & self , rhs : impl Into < Self > ) -> Option < DayTimeDuration > {
pub fn checked_sub ( self , rhs : impl Into < Self > ) -> Option < DayTimeDuration > {
self . timestamp . checked_sub ( rhs . into ( ) . timestamp )
self . timestamp . checked_sub ( rhs . into ( ) . timestamp )
}
}
/// [op:add-yearMonthDuration-to-date](https://www.w3.org/TR/xpath-functions-31/#func-add-yearMonthDuration-to-date)
/// [op:add-yearMonthDuration-to-date](https://www.w3.org/TR/xpath-functions-31/#func-add-yearMonthDuration-to-date)
#[ inline ]
#[ inline ]
pub fn checked_add_year_month_duration (
pub fn checked_add_year_month_duration (
& self ,
self ,
rhs : impl Into < YearMonthDuration > ,
rhs : impl Into < YearMonthDuration > ,
) -> Option < Self > {
) -> Option < Self > {
self . checked_add_duration ( Duration ::from ( rhs . into ( ) ) )
self . checked_add_duration ( Duration ::from ( rhs . into ( ) ) )
@ -564,14 +564,14 @@ impl Date {
/// [op:add-dayTimeDuration-to-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-add-dayTimeDuration-to-date)
/// [op:add-dayTimeDuration-to-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-add-dayTimeDuration-to-date)
#[ inline ]
#[ inline ]
pub fn checked_add_day_time_duration ( & self , rhs : impl Into < DayTimeDuration > ) -> Option < Self > {
pub fn checked_add_day_time_duration ( self , rhs : impl Into < DayTimeDuration > ) -> Option < Self > {
self . checked_add_duration ( Duration ::from ( rhs . into ( ) ) )
self . checked_add_duration ( Duration ::from ( rhs . into ( ) ) )
}
}
/// [op:add-yearMonthDuration-to-date](https://www.w3.org/TR/xpath-functions-31/#func-add-yearMonthDuration-to-date) and [op:add-dayTimeDuration-to-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-add-dayTimeDuration-to-date)
/// [op:add-yearMonthDuration-to-date](https://www.w3.org/TR/xpath-functions-31/#func-add-yearMonthDuration-to-date) and [op:add-dayTimeDuration-to-dateTime](https://www.w3.org/TR/xpath-functions-31/#func-add-dayTimeDuration-to-date)
#[ inline ]
#[ inline ]
pub fn checked_add_duration ( & self , rhs : impl Into < Duration > ) -> Option < Self > {
pub fn checked_add_duration ( self , rhs : impl Into < Duration > ) -> Option < Self > {
DateTime ::try_from ( * self )
DateTime ::try_from ( self )
. ok ( ) ?
. ok ( ) ?
. checked_add_duration ( rhs ) ?
. checked_add_duration ( rhs ) ?
. try_into ( )
. try_into ( )
@ -581,7 +581,7 @@ impl Date {
/// [op:subtract-yearMonthDuration-from-date](https://www.w3.org/TR/xpath-functions-31/#func-subtract-yearMonthDuration-from-date)
/// [op:subtract-yearMonthDuration-from-date](https://www.w3.org/TR/xpath-functions-31/#func-subtract-yearMonthDuration-from-date)
#[ inline ]
#[ inline ]
pub fn checked_sub_year_month_duration (
pub fn checked_sub_year_month_duration (
& self ,
self ,
rhs : impl Into < YearMonthDuration > ,
rhs : impl Into < YearMonthDuration > ,
) -> Option < Self > {
) -> Option < Self > {
self . checked_sub_duration ( Duration ::from ( rhs . into ( ) ) )
self . checked_sub_duration ( Duration ::from ( rhs . into ( ) ) )
@ -589,14 +589,14 @@ impl Date {
/// [op:subtract-dayTimeDuration-from-date](https://www.w3.org/TR/xpath-functions-31/#func-subtract-dayTimeDuration-from-date)
/// [op:subtract-dayTimeDuration-from-date](https://www.w3.org/TR/xpath-functions-31/#func-subtract-dayTimeDuration-from-date)
#[ inline ]
#[ inline ]
pub fn checked_sub_day_time_duration ( & self , rhs : impl Into < DayTimeDuration > ) -> Option < Self > {
pub fn checked_sub_day_time_duration ( self , rhs : impl Into < DayTimeDuration > ) -> Option < Self > {
self . checked_sub_duration ( Duration ::from ( rhs . into ( ) ) )
self . checked_sub_duration ( Duration ::from ( rhs . into ( ) ) )
}
}
/// [op:subtract-yearMonthDuration-from-date](https://www.w3.org/TR/xpath-functions-31/#func-subtract-yearMonthDuration-from-date) and [op:subtract-dayTimeDuration-from-date](https://www.w3.org/TR/xpath-functions-31/#func-subtract-dayTimeDuration-from-date)
/// [op:subtract-yearMonthDuration-from-date](https://www.w3.org/TR/xpath-functions-31/#func-subtract-yearMonthDuration-from-date) and [op:subtract-dayTimeDuration-from-date](https://www.w3.org/TR/xpath-functions-31/#func-subtract-dayTimeDuration-from-date)
#[ inline ]
#[ inline ]
pub fn checked_sub_duration ( & self , rhs : impl Into < Duration > ) -> Option < Self > {
pub fn checked_sub_duration ( self , rhs : impl Into < Duration > ) -> Option < Self > {
DateTime ::try_from ( * self )
DateTime ::try_from ( self )
. ok ( ) ?
. ok ( ) ?
. checked_sub_duration ( rhs ) ?
. checked_sub_duration ( rhs ) ?
. try_into ( )
. try_into ( )
@ -605,7 +605,7 @@ impl Date {
// [fn:adjust-date-to-timezone](https://www.w3.org/TR/xpath-functions-31/#func-adjust-date-to-timezone)
// [fn:adjust-date-to-timezone](https://www.w3.org/TR/xpath-functions-31/#func-adjust-date-to-timezone)
#[ inline ]
#[ inline ]
pub fn adjust ( & self , timezone_offset : Option < TimezoneOffset > ) -> Option < Self > {
pub fn adjust ( self , timezone_offset : Option < TimezoneOffset > ) -> Option < Self > {
DateTime ::new (
DateTime ::new (
self . year ( ) ,
self . year ( ) ,
self . month ( ) ,
self . month ( ) ,
@ -623,8 +623,8 @@ impl Date {
/// Checks if the two values are [identical](https://www.w3.org/TR/xmlschema11-2/#identity).
/// Checks if the two values are [identical](https://www.w3.org/TR/xmlschema11-2/#identity).
#[ inline ]
#[ inline ]
pub fn is_identical_with ( & self , other : & Self ) -> bool {
pub fn is_identical_with ( self , other : Self ) -> bool {
self . timestamp . is_identical_with ( & other . timestamp )
self . timestamp . is_identical_with ( other . timestamp )
}
}
}
}
@ -703,27 +703,27 @@ impl GYearMonth {
}
}
#[ inline ]
#[ inline ]
pub fn year ( & self ) -> i64 {
pub fn year ( self ) -> i64 {
self . timestamp . year ( )
self . timestamp . year ( )
}
}
#[ inline ]
#[ inline ]
pub fn month ( & self ) -> u8 {
pub fn month ( self ) -> u8 {
self . timestamp . month ( )
self . timestamp . month ( )
}
}
#[ inline ]
#[ inline ]
pub fn timezone ( & self ) -> Option < DayTimeDuration > {
pub fn timezone ( self ) -> Option < DayTimeDuration > {
Some ( self . timezone_offset ( ) ? . into ( ) )
Some ( self . timezone_offset ( ) ? . into ( ) )
}
}
#[ inline ]
#[ inline ]
pub fn timezone_offset ( & self ) -> Option < TimezoneOffset > {
pub fn timezone_offset ( self ) -> Option < TimezoneOffset > {
self . timestamp . timezone_offset ( )
self . timestamp . timezone_offset ( )
}
}
#[ inline ]
#[ inline ]
pub fn adjust ( & self , timezone_offset : Option < TimezoneOffset > ) -> Option < Self > {
pub fn adjust ( self , timezone_offset : Option < TimezoneOffset > ) -> Option < Self > {
Some ( Self {
Some ( Self {
timestamp : self . timestamp . adjust ( timezone_offset ) ? ,
timestamp : self . timestamp . adjust ( timezone_offset ) ? ,
} )
} )
@ -736,8 +736,8 @@ impl GYearMonth {
/// Checks if the two values are [identical](https://www.w3.org/TR/xmlschema11-2/#identity).
/// Checks if the two values are [identical](https://www.w3.org/TR/xmlschema11-2/#identity).
#[ inline ]
#[ inline ]
pub fn is_identical_with ( & self , other : & Self ) -> bool {
pub fn is_identical_with ( self , other : Self ) -> bool {
self . timestamp . is_identical_with ( & other . timestamp )
self . timestamp . is_identical_with ( other . timestamp )
}
}
}
}
@ -824,22 +824,22 @@ impl GYear {
}
}
#[ inline ]
#[ inline ]
pub fn year ( & self ) -> i64 {
pub fn year ( self ) -> i64 {
self . timestamp . year ( )
self . timestamp . year ( )
}
}
#[ inline ]
#[ inline ]
pub fn timezone ( & self ) -> Option < DayTimeDuration > {
pub fn timezone ( self ) -> Option < DayTimeDuration > {
Some ( self . timezone_offset ( ) ? . into ( ) )
Some ( self . timezone_offset ( ) ? . into ( ) )
}
}
#[ inline ]
#[ inline ]
pub fn timezone_offset ( & self ) -> Option < TimezoneOffset > {
pub fn timezone_offset ( self ) -> Option < TimezoneOffset > {
self . timestamp . timezone_offset ( )
self . timestamp . timezone_offset ( )
}
}
#[ inline ]
#[ inline ]
pub fn adjust ( & self , timezone_offset : Option < TimezoneOffset > ) -> Option < Self > {
pub fn adjust ( self , timezone_offset : Option < TimezoneOffset > ) -> Option < Self > {
Some ( Self {
Some ( Self {
timestamp : self . timestamp . adjust ( timezone_offset ) ? ,
timestamp : self . timestamp . adjust ( timezone_offset ) ? ,
} )
} )
@ -852,8 +852,8 @@ impl GYear {
/// Checks if the two values are [identical](https://www.w3.org/TR/xmlschema11-2/#identity).
/// Checks if the two values are [identical](https://www.w3.org/TR/xmlschema11-2/#identity).
#[ inline ]
#[ inline ]
pub fn is_identical_with ( & self , other : & Self ) -> bool {
pub fn is_identical_with ( self , other : Self ) -> bool {
self . timestamp . is_identical_with ( & other . timestamp )
self . timestamp . is_identical_with ( other . timestamp )
}
}
}
}
@ -979,8 +979,8 @@ impl GMonthDay {
/// Checks if the two values are [identical](https://www.w3.org/TR/xmlschema11-2/#identity).
/// Checks if the two values are [identical](https://www.w3.org/TR/xmlschema11-2/#identity).
#[ inline ]
#[ inline ]
pub fn is_identical_with ( & self , other : & Self ) -> bool {
pub fn is_identical_with ( self , other : Self ) -> bool {
self . timestamp . is_identical_with ( & other . timestamp )
self . timestamp . is_identical_with ( other . timestamp )
}
}
}
}
@ -1091,8 +1091,8 @@ impl GMonth {
/// Checks if the two values are [identical](https://www.w3.org/TR/xmlschema11-2/#identity).
/// Checks if the two values are [identical](https://www.w3.org/TR/xmlschema11-2/#identity).
#[ inline ]
#[ inline ]
pub fn is_identical_with ( & self , other : & Self ) -> bool {
pub fn is_identical_with ( self , other : Self ) -> bool {
self . timestamp . is_identical_with ( & other . timestamp )
self . timestamp . is_identical_with ( other . timestamp )
}
}
}
}
@ -1217,8 +1217,8 @@ impl GDay {
/// Checks if the two values are [identical](https://www.w3.org/TR/xmlschema11-2/#identity).
/// Checks if the two values are [identical](https://www.w3.org/TR/xmlschema11-2/#identity).
#[ inline ]
#[ inline ]
pub fn is_identical_with ( & self , other : & Self ) -> bool {
pub fn is_identical_with ( self , other : Self ) -> bool {
self . timestamp . is_identical_with ( & other . timestamp )
self . timestamp . is_identical_with ( other . timestamp )
}
}
}
}
@ -1650,7 +1650,7 @@ impl Timestamp {
/// Checks if the two values are [identical](https://www.w3.org/TR/xmlschema11-2/#identity).
/// Checks if the two values are [identical](https://www.w3.org/TR/xmlschema11-2/#identity).
#[ inline ]
#[ inline ]
pub fn is_identical_with ( & self , other : & Self ) -> bool {
pub fn is_identical_with ( self , other : Self ) -> bool {
self . value = = other . value & & self . timezone_offset = = other . timezone_offset
self . value = = other . value & & self . timezone_offset = = other . timezone_offset
}
}
}
}