Unicode Extensions provide information about user preferences in a given locale.
A list of Unicode BCP47 U Extensions
as defined in Unicode Locale Identifier
specification.
Unicode extensions provide subtags that specify language and/or locale-based behavior
or refinements to language tags, according to work done by the Unicode Consortium.
(See RFC 6067
for details).
use icu::locid::Locale;
use icu::locid::extensions::unicode::{Key, Value};
let mut loc: Locale = "de-u-hc-h12-ca-buddhist".parse()
.expect("Parsing failed.");
let key: Key = "ca".parse().expect("Parsing key failed.");
let value: Value = "buddhist".parse().expect("Parsing value failed.");
assert_eq!(loc.extensions.unicode.keywords.get(key),
Some(&value));
Returns a new empty map of Unicode extensions. Same as default()
, but is const
.
use icu::locid::extensions::unicode::Unicode;
assert_eq!(Unicode::new(), Unicode::default());
Returns true
if there list of keywords and attributes is empty.
use icu::locid::Locale;
let loc: Locale = "en-US-u-foo".parse()
.expect("Parsing failed.");
assert_eq!(loc.extensions.unicode.is_empty(), false);
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Formats the value using the given formatter. Read more
#[must_use]
pub fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
#[must_use]
pub fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
#[must_use]
pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
Restrict a value to a certain interval. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]
pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]
pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]
pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]
pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
Writes bytes to the given sink. Errors from the sink are bubbled up.
Returns a hint for the number of bytes that will be written to the sink. Read more
Creates a new String with the data from this Writeable. Like ToString,
but smaller and faster. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
impl<T> ErasedDataStruct for T where
T: Clone + Debug + Any,
pub fn clone_into_box(&self) -> Box<dyn ErasedDataStruct + 'static, Global>
Clone this trait object reference, returning a boxed trait object.
pub fn as_any(&self) -> &(dyn Any + 'static)
impl<T, U> Into<U> for T where
U: From<T>,
[src]
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String
. Read more
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.