Trait icu::datetime::scaffold::DateTimeNamesFrom

source ·
pub trait DateTimeNamesFrom<M>: DateTimeNamesMarker{
    // Required methods
    fn map_year_names(
        other: <<M as DateTimeNamesMarker>::YearNames as NamesContainer<YearNamesV1Marker, FieldLength>>::Container,
    ) -> <Self::YearNames as NamesContainer<YearNamesV1Marker, FieldLength>>::Container;
    fn map_month_names(
        other: <<M as DateTimeNamesMarker>::MonthNames as NamesContainer<MonthNamesV1Marker, (Month, FieldLength)>>::Container,
    ) -> <Self::MonthNames as NamesContainer<MonthNamesV1Marker, (Month, FieldLength)>>::Container;
    fn map_weekday_names(
        other: <<M as DateTimeNamesMarker>::WeekdayNames as NamesContainer<WeekdayNamesV1Marker, (Weekday, FieldLength)>>::Container,
    ) -> <Self::WeekdayNames as NamesContainer<WeekdayNamesV1Marker, (Weekday, FieldLength)>>::Container;
    fn map_day_period_names(
        other: <<M as DateTimeNamesMarker>::DayPeriodNames as NamesContainer<DayPeriodNamesV1Marker, FieldLength>>::Container,
    ) -> <Self::DayPeriodNames as NamesContainer<DayPeriodNamesV1Marker, FieldLength>>::Container;
    fn map_zone_essentials(
        other: <<M as DateTimeNamesMarker>::ZoneEssentials as NamesContainer<TimeZoneEssentialsV1Marker, ()>>::Container,
    ) -> <Self::ZoneEssentials as NamesContainer<TimeZoneEssentialsV1Marker, ()>>::Container;
    fn map_zone_locations(
        other: <<M as DateTimeNamesMarker>::ZoneLocations as NamesContainer<LocationsV1Marker, ()>>::Container,
    ) -> <Self::ZoneLocations as NamesContainer<LocationsV1Marker, ()>>::Container;
    fn map_zone_generic_long(
        other: <<M as DateTimeNamesMarker>::ZoneGenericLong as NamesContainer<MetazoneGenericNamesLongV1Marker, ()>>::Container,
    ) -> <Self::ZoneGenericLong as NamesContainer<MetazoneGenericNamesLongV1Marker, ()>>::Container;
    fn map_zone_generic_short(
        other: <<M as DateTimeNamesMarker>::ZoneGenericShort as NamesContainer<MetazoneGenericNamesShortV1Marker, ()>>::Container,
    ) -> <Self::ZoneGenericShort as NamesContainer<MetazoneGenericNamesShortV1Marker, ()>>::Container;
    fn map_zone_specific_long(
        other: <<M as DateTimeNamesMarker>::ZoneSpecificLong as NamesContainer<MetazoneSpecificNamesLongV1Marker, ()>>::Container,
    ) -> <Self::ZoneSpecificLong as NamesContainer<MetazoneSpecificNamesLongV1Marker, ()>>::Container;
    fn map_zone_specific_short(
        other: <<M as DateTimeNamesMarker>::ZoneSpecificShort as NamesContainer<MetazoneSpecificNamesShortV1Marker, ()>>::Container,
    ) -> <Self::ZoneSpecificShort as NamesContainer<MetazoneSpecificNamesShortV1Marker, ()>>::Container;
    fn map_metazone_lookup(
        other: <<M as DateTimeNamesMarker>::MetazoneLookup as NamesContainer<MetazonePeriodV1Marker, ()>>::Container,
    ) -> <Self::MetazoneLookup as NamesContainer<MetazonePeriodV1Marker, ()>>::Container;
}
Expand description

A trait for a DateTimeNamesMarker that can be created from a more specific one, M.

This trait is blanket-implemented on all field sets that are more general than M.

§Examples

Example pairs of field sets where the trait is implemented:

use icu::datetime::fieldsets::T;
use icu::datetime::fieldsets::YMD;
use icu::datetime::fieldsets::enums::DateFieldSet;
use icu::datetime::fieldsets::enums::TimeFieldSet;
use icu::datetime::fieldsets::enums::CompositeDateTimeFieldSet;
use icu::datetime::fieldsets::enums::CompositeFieldSet;
use icu::datetime::scaffold::DateTimeNamesFrom;
use icu::datetime::scaffold::DateTimeNamesMarker;

fn is_trait_implemented<Source, Target>()
where
    Source: DateTimeNamesMarker,
    Target: DateTimeNamesFrom<Source>
{}

is_trait_implemented::<YMD, DateFieldSet>();
is_trait_implemented::<YMD, CompositeDateTimeFieldSet>();
is_trait_implemented::<YMD, CompositeFieldSet>();
is_trait_implemented::<T, TimeFieldSet>();
is_trait_implemented::<T, CompositeDateTimeFieldSet>();
is_trait_implemented::<T, CompositeFieldSet>();
is_trait_implemented::<DateFieldSet, CompositeDateTimeFieldSet>();
is_trait_implemented::<DateFieldSet, CompositeFieldSet>();
is_trait_implemented::<TimeFieldSet, CompositeDateTimeFieldSet>();
is_trait_implemented::<TimeFieldSet, CompositeFieldSet>();

Required Methods§

source

fn map_year_names( other: <<M as DateTimeNamesMarker>::YearNames as NamesContainer<YearNamesV1Marker, FieldLength>>::Container, ) -> <Self::YearNames as NamesContainer<YearNamesV1Marker, FieldLength>>::Container

source

fn map_month_names( other: <<M as DateTimeNamesMarker>::MonthNames as NamesContainer<MonthNamesV1Marker, (Month, FieldLength)>>::Container, ) -> <Self::MonthNames as NamesContainer<MonthNamesV1Marker, (Month, FieldLength)>>::Container

source

fn map_weekday_names( other: <<M as DateTimeNamesMarker>::WeekdayNames as NamesContainer<WeekdayNamesV1Marker, (Weekday, FieldLength)>>::Container, ) -> <Self::WeekdayNames as NamesContainer<WeekdayNamesV1Marker, (Weekday, FieldLength)>>::Container

source

fn map_day_period_names( other: <<M as DateTimeNamesMarker>::DayPeriodNames as NamesContainer<DayPeriodNamesV1Marker, FieldLength>>::Container, ) -> <Self::DayPeriodNames as NamesContainer<DayPeriodNamesV1Marker, FieldLength>>::Container

source

fn map_zone_essentials( other: <<M as DateTimeNamesMarker>::ZoneEssentials as NamesContainer<TimeZoneEssentialsV1Marker, ()>>::Container, ) -> <Self::ZoneEssentials as NamesContainer<TimeZoneEssentialsV1Marker, ()>>::Container

source

fn map_zone_locations( other: <<M as DateTimeNamesMarker>::ZoneLocations as NamesContainer<LocationsV1Marker, ()>>::Container, ) -> <Self::ZoneLocations as NamesContainer<LocationsV1Marker, ()>>::Container

source

fn map_zone_generic_long( other: <<M as DateTimeNamesMarker>::ZoneGenericLong as NamesContainer<MetazoneGenericNamesLongV1Marker, ()>>::Container, ) -> <Self::ZoneGenericLong as NamesContainer<MetazoneGenericNamesLongV1Marker, ()>>::Container

source

fn map_zone_generic_short( other: <<M as DateTimeNamesMarker>::ZoneGenericShort as NamesContainer<MetazoneGenericNamesShortV1Marker, ()>>::Container, ) -> <Self::ZoneGenericShort as NamesContainer<MetazoneGenericNamesShortV1Marker, ()>>::Container

source

fn map_zone_specific_long( other: <<M as DateTimeNamesMarker>::ZoneSpecificLong as NamesContainer<MetazoneSpecificNamesLongV1Marker, ()>>::Container, ) -> <Self::ZoneSpecificLong as NamesContainer<MetazoneSpecificNamesLongV1Marker, ()>>::Container

source

fn map_zone_specific_short( other: <<M as DateTimeNamesMarker>::ZoneSpecificShort as NamesContainer<MetazoneSpecificNamesShortV1Marker, ()>>::Container, ) -> <Self::ZoneSpecificShort as NamesContainer<MetazoneSpecificNamesShortV1Marker, ()>>::Container

source

fn map_metazone_lookup( other: <<M as DateTimeNamesMarker>::MetazoneLookup as NamesContainer<MetazonePeriodV1Marker, ()>>::Container, ) -> <Self::MetazoneLookup as NamesContainer<MetazonePeriodV1Marker, ()>>::Container

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<M, T> DateTimeNamesFrom<M> for T
where M: DateTimeNamesMarker, T: DateTimeNamesMarker, <<T as DateTimeNamesMarker>::YearNames as NamesContainer<YearNamesV1Marker, FieldLength>>::Container: From<<<M as DateTimeNamesMarker>::YearNames as NamesContainer<YearNamesV1Marker, FieldLength>>::Container>, <<T as DateTimeNamesMarker>::MonthNames as NamesContainer<MonthNamesV1Marker, (Month, FieldLength)>>::Container: From<<<M as DateTimeNamesMarker>::MonthNames as NamesContainer<MonthNamesV1Marker, (Month, FieldLength)>>::Container>, <<T as DateTimeNamesMarker>::WeekdayNames as NamesContainer<WeekdayNamesV1Marker, (Weekday, FieldLength)>>::Container: From<<<M as DateTimeNamesMarker>::WeekdayNames as NamesContainer<WeekdayNamesV1Marker, (Weekday, FieldLength)>>::Container>, <<T as DateTimeNamesMarker>::DayPeriodNames as NamesContainer<DayPeriodNamesV1Marker, FieldLength>>::Container: From<<<M as DateTimeNamesMarker>::DayPeriodNames as NamesContainer<DayPeriodNamesV1Marker, FieldLength>>::Container>, <<T as DateTimeNamesMarker>::ZoneEssentials as NamesContainer<TimeZoneEssentialsV1Marker, ()>>::Container: From<<<M as DateTimeNamesMarker>::ZoneEssentials as NamesContainer<TimeZoneEssentialsV1Marker, ()>>::Container>, <<T as DateTimeNamesMarker>::ZoneLocations as NamesContainer<LocationsV1Marker, ()>>::Container: From<<<M as DateTimeNamesMarker>::ZoneLocations as NamesContainer<LocationsV1Marker, ()>>::Container>, <<T as DateTimeNamesMarker>::ZoneGenericLong as NamesContainer<MetazoneGenericNamesLongV1Marker, ()>>::Container: From<<<M as DateTimeNamesMarker>::ZoneGenericLong as NamesContainer<MetazoneGenericNamesLongV1Marker, ()>>::Container>, <<T as DateTimeNamesMarker>::ZoneGenericShort as NamesContainer<MetazoneGenericNamesShortV1Marker, ()>>::Container: From<<<M as DateTimeNamesMarker>::ZoneGenericShort as NamesContainer<MetazoneGenericNamesShortV1Marker, ()>>::Container>, <<T as DateTimeNamesMarker>::ZoneSpecificLong as NamesContainer<MetazoneSpecificNamesLongV1Marker, ()>>::Container: From<<<M as DateTimeNamesMarker>::ZoneSpecificLong as NamesContainer<MetazoneSpecificNamesLongV1Marker, ()>>::Container>, <<T as DateTimeNamesMarker>::ZoneSpecificShort as NamesContainer<MetazoneSpecificNamesShortV1Marker, ()>>::Container: From<<<M as DateTimeNamesMarker>::ZoneSpecificShort as NamesContainer<MetazoneSpecificNamesShortV1Marker, ()>>::Container>, <<T as DateTimeNamesMarker>::MetazoneLookup as NamesContainer<MetazonePeriodV1Marker, ()>>::Container: From<<<M as DateTimeNamesMarker>::MetazoneLookup as NamesContainer<MetazonePeriodV1Marker, ()>>::Container>,