icu_datetime::scaffold

Trait ConvertCalendar

Source
pub trait ConvertCalendar {
    type Converted<'a>: Sized;

    // Required method
    fn to_calendar<'a>(&self, calendar: &'a AnyCalendar) -> Self::Converted<'a>;
}
Expand description

A type that can be converted into a specific calendar system.

Required Associated Types§

Source

type Converted<'a>: Sized

The converted type. This can be the same as the receiver type.

Required Methods§

Source

fn to_calendar<'a>(&self, calendar: &'a AnyCalendar) -> Self::Converted<'a>

Converts self to the specified [AnyCalendar].

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl ConvertCalendar for Time

Source§

impl<C: IntoAnyCalendar, A: AsCalendar<Calendar = C>> ConvertCalendar for Date<A>

Source§

type Converted<'a> = Date<Ref<'a, AnyCalendar>>

Source§

impl<C: IntoAnyCalendar, A: AsCalendar<Calendar = C>> ConvertCalendar for DateTime<A>

Source§

type Converted<'a> = DateTime<Ref<'a, AnyCalendar>>

Source§

impl<C: IntoAnyCalendar, A: AsCalendar<Calendar = C>, Z: Copy> ConvertCalendar for ZonedDateTime<A, Z>

Source§

type Converted<'a> = ZonedDateTime<Ref<'a, AnyCalendar>, Z>

Source§

impl<O: TimeZoneModel> ConvertCalendar for TimeZoneInfo<O>