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.

MDN documentation

Implementations

impl Locale

fn get_hour_cycles(&self) -> Array<JsString>

Returns an array of available hour cycles for the locale.

MDN documentation

impl Locale

fn maximize(&self) -> Locale

Returns a new Locale with the specified calendar.

MDN documentation

impl Locale

fn new(tag: &str) -> Result<Locale, JsValue>

Creates a new Intl.Locale object.

MDN documentation

impl Locale

fn calendar(&self) -> Option<JsString>

The calendar type for the locale.

MDN documentation

impl Locale

fn hour_cycle(&self) -> Option<JsString>

The hour cycle for the locale.

MDN documentation

impl Locale

fn numeric(&self) -> bool

Whether the locale uses numeric collation.

MDN documentation

impl Locale

fn get_calendars(&self) -> Array<JsString>

Returns an array of available calendars for the locale.

MDN documentation

impl Locale

fn get_numbering_systems(&self) -> Array<JsString>

Returns an array of available numbering systems for the locale.

MDN documentation

impl Locale

fn minimize(&self) -> Locale

Returns a new Locale with the minimal subtags.

MDN documentation

impl Locale

fn new_with_options(tag: &str, options: &Object) -> Result<Locale, JsValue>

Creates a new Intl.Locale object with options.

MDN documentation

impl Locale

fn case_first(&self) -> Option<JsString>

The case first sorting option.

MDN documentation

impl Locale

fn language(&self) -> JsString

The language code for the locale.

MDN documentation

impl Locale

fn region(&self) -> Option<JsString>

The region code for the locale.

MDN documentation

impl Locale

fn get_collations(&self) -> Array<JsString>

Returns an array of available collations for the locale.

MDN documentation

impl Locale

fn get_time_zones(&self) -> Option<Array<JsString>>

Returns an array of available time zones for the locale's region.

MDN documentation

impl Locale

fn get_week_info(&self) -> Result<WeekInfo, JsValue>

Returns week information for the locale.

May not be available in all environments.

MDN documentation

impl Locale

fn get_text_info(&self) -> Result<TextInfo, JsValue>

Returns text layout information for the locale.

May not be available in all environments.

MDN documentation

impl Locale

fn base_name(&self) -> JsString

The base name of the locale (language + region + script).

MDN documentation

impl Locale

fn collation(&self) -> Option<JsString>

The collation type for the locale.

MDN documentation

impl Locale

fn numbering_system(&self) -> Option<JsString>

The numbering system for the locale.

MDN documentation

impl Locale

fn script(&self) -> Option<JsString>

The script code for the locale.

MDN documentation

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) -> bool
fn unchecked_from_js(val: JsValue) -> Self
fn 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()

Auto Trait Implementations

impl Freeze for Locale

impl RefUnwindSafe for Locale

impl Send for Locale

impl Sync for Locale

impl Unpin for Locale

impl UnsafeUnpin for Locale

impl UnwindSafe for Locale

Blanket Implementations

impl<P, T> Receiver for Locale where P: Deref<Target = T> + ?Sized, T: ?Sized,

impl<S, T> Upcast<T> for Locale where T: UpcastFrom<S> + ?Sized, S: ?Sized,

impl<T> Any for Locale where T: 'static + ?Sized,

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

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

impl<T> CloneToUninit for Locale where T: Clone,

impl<T> From<T> for Locale

impl<T> JsGeneric for Locale where T: ErasableGeneric<Repr = JsValue> + UpcastFrom<T> + Upcast<JsValue> + JsCast + 'static,

impl<T> ReturnWasmAbi for Locale where T: IntoWasmAbi,

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

impl<T> TryFromJsValue for Locale where T: JsCast,

impl<T> VectorFromWasmAbi for Locale where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorIntoWasmAbi for Locale where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorRefIntoWasmAbi for Locale where &'a T: for<'a> Into<JsValue>,

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

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

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