Struct Locale
#[repr(transparent)]
pub struct Locale { /* private fields */ }
The Intl.Locale object is a standard built-in property of the Intl object
that represents a Unicode locale identifier.
Implementations
impl Locale
fn get_hour_cycles(&self) -> Array<JsString>Returns an array of available hour cycles for the locale.
impl Locale
fn maximize(&self) -> LocaleReturns a new Locale with the specified calendar.
impl Locale
fn new(tag: &str) -> Result<Locale, JsValue>Creates a new
Intl.Localeobject.
impl Locale
fn calendar(&self) -> Option<JsString>The calendar type for the locale.
impl Locale
fn hour_cycle(&self) -> Option<JsString>The hour cycle for the locale.
impl Locale
fn numeric(&self) -> boolWhether the locale uses numeric collation.
impl Locale
fn get_calendars(&self) -> Array<JsString>Returns an array of available calendars for the locale.
impl Locale
fn get_numbering_systems(&self) -> Array<JsString>Returns an array of available numbering systems for the locale.
impl Locale
fn minimize(&self) -> LocaleReturns a new Locale with the minimal subtags.
impl Locale
fn new_with_options(tag: &str, options: &Object) -> Result<Locale, JsValue>Creates a new
Intl.Localeobject with options.
impl Locale
fn case_first(&self) -> Option<JsString>The case first sorting option.
impl Locale
fn language(&self) -> JsStringThe language code for the locale.
impl Locale
fn region(&self) -> Option<JsString>The region code for the locale.
impl Locale
fn get_collations(&self) -> Array<JsString>Returns an array of available collations for the locale.
impl Locale
fn get_time_zones(&self) -> Option<Array<JsString>>Returns an array of available time zones for the locale's region.
impl Locale
fn get_week_info(&self) -> Result<WeekInfo, JsValue>Returns week information for the locale.
May not be available in all environments.
impl Locale
fn get_text_info(&self) -> Result<TextInfo, JsValue>Returns text layout information for the locale.
May not be available in all environments.
impl Locale
fn base_name(&self) -> JsStringThe base name of the locale (language + region + script).
impl Locale
fn collation(&self) -> Option<JsString>The collation type for the locale.
impl Locale
fn numbering_system(&self) -> Option<JsString>The numbering system for the locale.
impl Locale
fn script(&self) -> Option<JsString>The script code for the locale.
Trait Implementations
impl AsRef<JsValue> for Locale
fn as_ref(&self) -> &JsValue
impl AsRef<Locale> for Locale
fn as_ref(&self) -> &Locale
impl AsRef<Object> for Locale
fn as_ref(&self) -> &Object
impl Clone for Locale
fn clone(&self) -> Self
impl Debug for Locale
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Deref for Locale
type Target = Object;fn deref(&self) -> &Object
impl ErasableGeneric for Locale
type Repr = JsValue;
impl From<JsValue> for Locale
fn from(obj: JsValue) -> Self
impl FromWasmAbi for Locale
type Abi = <JsValue as FromWasmAbi>::Abi;unsafe fn from_abi(js: Self::Abi) -> Self
impl IntoJsGeneric for Locale
where
Locale: JsGeneric,
type JsCanon = Locale;fn to_js(self) -> Locale
impl IntoWasmAbi for Locale
type Abi = <JsValue as IntoWasmAbi>::Abi;fn into_abi(self) -> Self::Abi
impl JsCast for Locale
fn instanceof(val: &JsValue) -> boolfn unchecked_from_js(val: JsValue) -> Selffn unchecked_from_js_ref(val: &JsValue) -> &Self
impl LongRefFromWasmAbi for Locale
type Abi = <JsValue as LongRefFromWasmAbi>::Abi;type Anchor = Locale;unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
impl OptionFromWasmAbi for Locale
fn is_none(abi: &Self::Abi) -> bool
impl OptionIntoWasmAbi for Locale
fn none() -> Self::Abi
impl Promising for Locale
type Resolution = Locale;
impl RefFromWasmAbi for Locale
type Abi = <JsValue as RefFromWasmAbi>::Abi;type Anchor = ManuallyDrop<Locale>;unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
impl UpcastFrom<Locale> for Locale
impl WasmDescribe for Locale
fn describe()