Struct Unicode
struct Unicode { ... }
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).
Examples
use ;
use Locale;
let loc: Locale =
"de-u-hc-h12-ca-buddhist".parse.expect;
assert_eq!;
Fields
keywords: KeywordsThe key-value pairs present in this locale extension, with each extension key subtag associated to its provided value subtag.
attributes: AttributesA canonically ordered sequence of single standalone subtags for this locale extension.
Implementations
impl Unicode
impl Unicode
const fn new() -> SelfReturns a new empty map of Unicode extensions. Same as
default(), but isconst.Examples
use Unicode; assert_eq!;fn is_empty(self: &Self) -> boolReturns
trueif there list of keywords and attributes is empty.Examples
use Locale; let loc: Locale = "en-US-u-foo".parse.expect; assert!;fn clear(self: &mut Self)Clears all Unicode extension keywords and attributes, effectively removing the Unicode extension.
Example
use Locale; let mut loc: Locale = "und-t-mul-u-hello-ca-buddhist-hc-h12".parse.unwrap; loc.extensions.unicode.clear; assert_eq!;fn total_cmp(self: &Self, other: &Self) -> OrderingReturns an ordering suitable for use in
BTreeSet.The ordering may or may not be equivalent to string ordering, and it may or may not be stable across ICU4X releases.
impl Clone for Unicode
fn clone(self: &Self) -> Unicode
impl Debug for Unicode
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Default for Unicode
fn default() -> Unicode
impl Display for Unicode
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Eq for Unicode
impl Freeze for Unicode
impl Hash for Unicode
fn hash<__H: $crate::hash::Hasher>(self: &Self, state: &mut __H)
impl PartialEq for Unicode
fn eq(self: &Self, other: &Unicode) -> bool
impl RefUnwindSafe for Unicode
impl Send for Unicode
impl StructuralPartialEq for Unicode
impl Sync for Unicode
impl Unpin for Unicode
impl UnsafeUnpin for Unicode
impl UnwindSafe for Unicode
impl Writeable for Unicode
fn write_to<W: core::fmt::Write + ?Sized>(self: &Self, sink: &mut W) -> Resultfn writeable_length_hint(self: &Self) -> LengthHint
impl<T> Any for Unicode
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Unicode
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Unicode
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for Unicode
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> ErasedDestructor for Unicode
impl<T> From for Unicode
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Unicode
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T> ToString for Unicode
fn to_string(self: &Self) -> String
impl<T, U> Into for Unicode
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Unicode
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Unicode
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>