Enum temporal_rs::components::calendar::CalendarSlot
source · pub enum CalendarSlot<C: CalendarProtocol> {
Builtin(AnyCalendar),
Protocol(C),
}
Expand description
The [[Calendar]]
field slot of a Temporal Object.
Variants§
Implementations§
source§impl<C: CalendarProtocol> CalendarSlot<C>
impl<C: CalendarProtocol> CalendarSlot<C>
source§impl<C: CalendarProtocol> CalendarSlot<C>
impl<C: CalendarProtocol> CalendarSlot<C>
sourcepub fn date_from_fields(
&self,
fields: &mut TemporalFields,
overflow: ArithmeticOverflow,
context: &mut C::Context
) -> TemporalResult<Date<C>>
pub fn date_from_fields( &self, fields: &mut TemporalFields, overflow: ArithmeticOverflow, context: &mut C::Context ) -> TemporalResult<Date<C>>
CalendarDateFromFields
sourcepub fn month_day_from_fields(
&self,
fields: &mut TemporalFields,
overflow: ArithmeticOverflow,
context: &mut C::Context
) -> TemporalResult<MonthDay<C>>
pub fn month_day_from_fields( &self, fields: &mut TemporalFields, overflow: ArithmeticOverflow, context: &mut C::Context ) -> TemporalResult<MonthDay<C>>
CalendarMonthDayFromFields
sourcepub fn year_month_from_fields(
&self,
fields: &mut TemporalFields,
overflow: ArithmeticOverflow,
context: &mut C::Context
) -> TemporalResult<YearMonth<C>>
pub fn year_month_from_fields( &self, fields: &mut TemporalFields, overflow: ArithmeticOverflow, context: &mut C::Context ) -> TemporalResult<YearMonth<C>>
CalendarYearMonthFromFields
sourcepub fn date_add(
&self,
date: &Date<C>,
duration: &Duration,
overflow: ArithmeticOverflow,
context: &mut C::Context
) -> TemporalResult<Date<C>>
pub fn date_add( &self, date: &Date<C>, duration: &Duration, overflow: ArithmeticOverflow, context: &mut C::Context ) -> TemporalResult<Date<C>>
CalendarDateAdd
sourcepub fn date_until(
&self,
one: &Date<C>,
two: &Date<C>,
largest_unit: TemporalUnit,
context: &mut C::Context
) -> TemporalResult<Duration>
pub fn date_until( &self, one: &Date<C>, two: &Date<C>, largest_unit: TemporalUnit, context: &mut C::Context ) -> TemporalResult<Duration>
CalendarDateUntil
sourcepub fn era(
&self,
date_like: &CalendarDateLike<C>,
context: &mut C::Context
) -> TemporalResult<Option<TinyAsciiStr<16>>>
pub fn era( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<Option<TinyAsciiStr<16>>>
CalendarEra
sourcepub fn era_year(
&self,
date_like: &CalendarDateLike<C>,
context: &mut C::Context
) -> TemporalResult<Option<i32>>
pub fn era_year( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<Option<i32>>
CalendarEraYear
sourcepub fn year(
&self,
date_like: &CalendarDateLike<C>,
context: &mut C::Context
) -> TemporalResult<i32>
pub fn year( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<i32>
CalendarYear
sourcepub fn month(
&self,
date_like: &CalendarDateLike<C>,
context: &mut C::Context
) -> TemporalResult<u8>
pub fn month( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<u8>
CalendarMonth
sourcepub fn month_code(
&self,
date_like: &CalendarDateLike<C>,
context: &mut C::Context
) -> TemporalResult<TinyAsciiStr<4>>
pub fn month_code( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<TinyAsciiStr<4>>
CalendarMonthCode
sourcepub fn day(
&self,
date_like: &CalendarDateLike<C>,
context: &mut C::Context
) -> TemporalResult<u8>
pub fn day( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<u8>
CalendarDay
sourcepub fn day_of_week(
&self,
date_like: &CalendarDateLike<C>,
context: &mut C::Context
) -> TemporalResult<u16>
pub fn day_of_week( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<u16>
CalendarDayOfWeek
sourcepub fn day_of_year(
&self,
date_like: &CalendarDateLike<C>,
context: &mut C::Context
) -> TemporalResult<u16>
pub fn day_of_year( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<u16>
CalendarDayOfYear
sourcepub fn week_of_year(
&self,
date_like: &CalendarDateLike<C>,
context: &mut C::Context
) -> TemporalResult<u16>
pub fn week_of_year( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<u16>
CalendarWeekOfYear
sourcepub fn year_of_week(
&self,
date_like: &CalendarDateLike<C>,
context: &mut C::Context
) -> TemporalResult<i32>
pub fn year_of_week( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<i32>
CalendarYearOfWeek
sourcepub fn days_in_week(
&self,
date_like: &CalendarDateLike<C>,
context: &mut C::Context
) -> TemporalResult<u16>
pub fn days_in_week( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<u16>
CalendarDaysInWeek
sourcepub fn days_in_month(
&self,
date_like: &CalendarDateLike<C>,
context: &mut C::Context
) -> TemporalResult<u16>
pub fn days_in_month( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<u16>
CalendarDaysInMonth
sourcepub fn days_in_year(
&self,
date_like: &CalendarDateLike<C>,
context: &mut C::Context
) -> TemporalResult<u16>
pub fn days_in_year( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<u16>
CalendarDaysInYear
sourcepub fn months_in_year(
&self,
date_like: &CalendarDateLike<C>,
context: &mut C::Context
) -> TemporalResult<u16>
pub fn months_in_year( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<u16>
CalendarMonthsInYear
sourcepub fn in_leap_year(
&self,
date_like: &CalendarDateLike<C>,
context: &mut C::Context
) -> TemporalResult<bool>
pub fn in_leap_year( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<bool>
CalendarInLeapYear
sourcepub fn fields(
&self,
fields: Vec<String>,
context: &mut C::Context
) -> TemporalResult<Vec<String>>
pub fn fields( &self, fields: Vec<String>, context: &mut C::Context ) -> TemporalResult<Vec<String>>
CalendarFields
sourcepub fn merge_fields(
&self,
fields: &TemporalFields,
additional_fields: &TemporalFields,
context: &mut C::Context
) -> TemporalResult<TemporalFields>
pub fn merge_fields( &self, fields: &TemporalFields, additional_fields: &TemporalFields, context: &mut C::Context ) -> TemporalResult<TemporalFields>
CalendarMergeFields
sourcepub fn identifier(&self, context: &mut C::Context) -> TemporalResult<String>
pub fn identifier(&self, context: &mut C::Context) -> TemporalResult<String>
Returns the identifier of this calendar slot.
source§impl<C: CalendarProtocol> CalendarSlot<C>
impl<C: CalendarProtocol> CalendarSlot<C>
sourcepub fn field_descriptors(
&self,
_fields_type: CalendarFieldsType
) -> TemporalResult<Vec<(String, bool)>>
pub fn field_descriptors( &self, _fields_type: CalendarFieldsType ) -> TemporalResult<Vec<(String, bool)>>
Returns the designated field descriptors for builtin calendars.
sourcepub fn field_keys_to_ignore(
&self,
_keys: &[String]
) -> TemporalResult<Vec<String>>
pub fn field_keys_to_ignore( &self, _keys: &[String] ) -> TemporalResult<Vec<String>>
Provides field keys to be ignored depending on the calendar.
sourcepub fn resolve_fields(
&self,
_fields: &mut TemporalFields,
_typ: CalendarFieldsType
) -> TemporalResult<()>
pub fn resolve_fields( &self, _fields: &mut TemporalFields, _typ: CalendarFieldsType ) -> TemporalResult<()>
CalendarResolveFields
Trait Implementations§
source§impl<C: CalendarProtocol> Clone for CalendarSlot<C>
impl<C: CalendarProtocol> Clone for CalendarSlot<C>
source§impl<C: Debug + CalendarProtocol> Debug for CalendarSlot<C>
impl<C: Debug + CalendarProtocol> Debug for CalendarSlot<C>
source§impl<C: CalendarProtocol> Default for CalendarSlot<C>
impl<C: CalendarProtocol> Default for CalendarSlot<C>
source§impl<C: CalendarProtocol> FromStr for CalendarSlot<C>
impl<C: CalendarProtocol> FromStr for CalendarSlot<C>
Auto Trait Implementations§
impl<C> RefUnwindSafe for CalendarSlot<C>where
C: RefUnwindSafe,
impl<C> !Send for CalendarSlot<C>
impl<C> !Sync for CalendarSlot<C>
impl<C> Unpin for CalendarSlot<C>where
C: Unpin,
impl<C> UnwindSafe for CalendarSlot<C>where
C: UnwindSafe,
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