Skip to main content

Module prelude

Module prelude 

Source

Structs§

CurrencyCode
A normalized 3-letter currency code identifier.
LanguageCode
A normalized 2-letter or 3-letter language subtag.
LocaleMatch
A simple locale match result.
LocalePreference
A normalized locale preference with an explicit priority.
LocaleTag
A normalized locale tag.
LocaleTagParts
Parsed locale tag components.
RegionCode
A normalized region subtag.
ScriptCode
A normalized 4-letter writing script subtag.
TimeZoneId
A syntactically valid IANA-shaped time zone identifier.
TimeZoneOffset
A fixed UTC offset in signed minutes.

Enums§

TimeZone
A time zone represented by either an IANA-shaped identifier or a fixed offset.
TimeZoneParseError
A time zone or fixed-offset parse error.

Functions§

best_locale_match
Finds the best available locale for a requested locale.
fallback_chain
Builds a most-specific to least-specific fallback chain for a locale tag.
is_currency_code
Returns true when the input is a 3-letter currency code identifier.
is_language_code
Returns true when the input is a simple 2-letter or 3-letter language subtag.
is_locale_tag
Returns true when the input is a supported locale tag shape.
is_region_code
Returns true when the input is a 2-letter or 3-digit region subtag.
is_script_code
Returns true when the input is a 4-letter script subtag.
is_time_zone
Returns true when the input is a valid IANA-shaped identifier or fixed offset.
is_time_zone_id
Returns true when the input is a syntactically valid IANA-shaped identifier.
is_time_zone_offset
Returns true when the input is a valid fixed time zone offset.
normalize_currency_code
Normalizes a 3-letter currency code identifier to uppercase.
normalize_language_code
Normalizes a simple language subtag to lowercase.
normalize_locale_tag
Normalizes a locale tag when it is syntactically valid for this crate’s subset.
normalize_region_code
Normalizes a 2-letter or 3-digit region subtag.
normalize_script_code
Normalizes a 4-letter script subtag to title case.
parse_currency_code
Parses a currency code identifier and normalizes it to uppercase.
parse_language_code
Parses a language subtag and normalizes it to lowercase.
parse_locale_tag
Parses a locale tag and normalizes its core language, script, and region subtags.
parse_locale_tag_parts
Parses a locale tag into normalized parts.
parse_region_code
Parses a region subtag and normalizes alphabetic regions to uppercase.
parse_script_code
Parses a script subtag and normalizes it to title case.
parse_time_zone
Parses a time zone from an IANA-shaped identifier or fixed offset.
parse_time_zone_id
Parses a syntactically valid IANA-shaped time zone identifier.
parse_time_zone_offset
Parses a fixed time zone offset.
split_time_zone_id
Splits a valid time zone identifier into owned segments.
try_parse_time_zone
Parses a time zone from an IANA-shaped identifier or fixed offset with diagnostic errors.
try_parse_time_zone_offset
Parses a fixed time zone offset with diagnostic errors.