pub enum CalendarSlot<C: CalendarProtocol> {
    Builtin(AnyCalendar),
    Protocol(C),
}
Expand description

The [[Calendar]] field slot of a Temporal Object.

Variants§

§

Builtin(AnyCalendar)

The calendar identifier string.

§

Protocol(C)

A CalendarProtocol implementation.

Implementations§

source§

impl<C: CalendarProtocol> CalendarSlot<C>

source

pub fn is_iso(&self) -> bool

Returns whether the current calendar is ISO

source§

impl<C: CalendarProtocol> CalendarSlot<C>

source

pub fn date_from_fields( &self, fields: &mut TemporalFields, overflow: ArithmeticOverflow, context: &mut C::Context ) -> TemporalResult<Date<C>>

CalendarDateFromFields

source

pub fn month_day_from_fields( &self, fields: &mut TemporalFields, overflow: ArithmeticOverflow, context: &mut C::Context ) -> TemporalResult<MonthDay<C>>

CalendarMonthDayFromFields

source

pub fn year_month_from_fields( &self, fields: &mut TemporalFields, overflow: ArithmeticOverflow, context: &mut C::Context ) -> TemporalResult<YearMonth<C>>

CalendarYearMonthFromFields

source

pub fn date_add( &self, date: &Date<C>, duration: &Duration, overflow: ArithmeticOverflow, context: &mut C::Context ) -> TemporalResult<Date<C>>

CalendarDateAdd

source

pub fn date_until( &self, one: &Date<C>, two: &Date<C>, largest_unit: TemporalUnit, context: &mut C::Context ) -> TemporalResult<Duration>

CalendarDateUntil

source

pub fn era( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<Option<TinyAsciiStr<16>>>

CalendarEra

source

pub fn era_year( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<Option<i32>>

CalendarEraYear

source

pub fn year( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<i32>

CalendarYear

source

pub fn month( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<u8>

CalendarMonth

source

pub fn month_code( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<TinyAsciiStr<4>>

CalendarMonthCode

source

pub fn day( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<u8>

CalendarDay

source

pub fn day_of_week( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<u16>

CalendarDayOfWeek

source

pub fn day_of_year( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<u16>

CalendarDayOfYear

source

pub fn week_of_year( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<u16>

CalendarWeekOfYear

source

pub fn year_of_week( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<i32>

CalendarYearOfWeek

source

pub fn days_in_week( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<u16>

CalendarDaysInWeek

source

pub fn days_in_month( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<u16>

CalendarDaysInMonth

source

pub fn days_in_year( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<u16>

CalendarDaysInYear

source

pub fn months_in_year( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<u16>

CalendarMonthsInYear

source

pub fn in_leap_year( &self, date_like: &CalendarDateLike<C>, context: &mut C::Context ) -> TemporalResult<bool>

CalendarInLeapYear

source

pub fn fields( &self, fields: Vec<String>, context: &mut C::Context ) -> TemporalResult<Vec<String>>

CalendarFields

source

pub fn merge_fields( &self, fields: &TemporalFields, additional_fields: &TemporalFields, context: &mut C::Context ) -> TemporalResult<TemporalFields>

CalendarMergeFields

source

pub fn identifier(&self, context: &mut C::Context) -> TemporalResult<String>

Returns the identifier of this calendar slot.

source§

impl<C: CalendarProtocol> CalendarSlot<C>

source

pub fn field_descriptors( &self, _fields_type: CalendarFieldsType ) -> TemporalResult<Vec<(String, bool)>>

Returns the designated field descriptors for builtin calendars.

source

pub fn field_keys_to_ignore( &self, _keys: &[String] ) -> TemporalResult<Vec<String>>

Provides field keys to be ignored depending on the calendar.

source

pub fn resolve_fields( &self, _fields: &mut TemporalFields, _typ: CalendarFieldsType ) -> TemporalResult<()>

CalendarResolveFields

Trait Implementations§

source§

impl<C: CalendarProtocol> Clone for CalendarSlot<C>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<C: Debug + CalendarProtocol> Debug for CalendarSlot<C>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<C: CalendarProtocol> Default for CalendarSlot<C>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<C: CalendarProtocol> FromStr for CalendarSlot<C>

§

type Err = TemporalError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T