Struct icu::locid::extensions::Unicode[][src]

pub struct Unicode {
    pub keywords: Keywords,
    pub attributes: Attributes,
}

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 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));

Fields

keywords: Keywordsattributes: Attributes

Implementations

impl Unicode[src]

pub const fn new() -> Unicode[src]

Returns a new empty map of Unicode extensions. Same as default(), but is const.

Examples

use icu::locid::extensions::unicode::Unicode;

assert_eq!(Unicode::new(), Unicode::default());

pub fn is_empty(&self) -> bool[src]

Returns true if there list of keywords and attributes is empty.

Examples

use icu::locid::Locale;

let loc: Locale = "en-US-u-foo".parse()
    .expect("Parsing failed.");

assert_eq!(loc.extensions.unicode.is_empty(), false);

Trait Implementations

impl Clone for Unicode[src]

impl Debug for Unicode[src]

impl Default for Unicode[src]

impl Display for Unicode[src]

impl Eq for Unicode[src]

impl Hash for Unicode[src]

impl Ord for Unicode[src]

impl PartialEq<Unicode> for Unicode[src]

impl PartialOrd<Unicode> for Unicode[src]

impl StructuralEq for Unicode[src]

impl StructuralPartialEq for Unicode[src]

impl Writeable for Unicode[src]

Auto Trait Implementations

impl RefUnwindSafe for Unicode

impl Send for Unicode

impl Sync for Unicode

impl Unpin for Unicode

impl UnwindSafe for Unicode

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> ErasedDataStruct for T where
    T: Clone + Debug + Any

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.