Struct icu_locid::extensions::unicode::Value[][src]

pub struct Value(_);

A value used in a list of Keywords.

The value has to be a sequence of one or more alphanumerical strings separated by -. Each part of the sequence has to be no shorter than three characters and no longer than 8.

Examples

use icu::locid::extensions::unicode::Value;

let value1: Value = "gregory".parse()
    .expect("Failed to parse a Value.");
let value2: Value = "islamic-civil".parse()
    .expect("Failed to parse a Value.");

assert_eq!(&value1.to_string(), "gregory");
assert_eq!(&value2.to_string(), "islamic-civil");

Implementations

impl Value[src]

pub fn from_bytes(input: &[u8]) -> Result<Self, ParserError>[src]

A constructor which takes a utf8 slice, parses it and produces a well-formed Value.

Examples

use icu::locid::extensions::unicode::Value;

let value = Value::from_bytes(b"buddhist")
    .expect("Parsing failed.");

assert_eq!(&value.to_string(), "buddhist");

Trait Implementations

impl Clone for Value[src]

impl Debug for Value[src]

impl Display for Value[src]

impl Eq for Value[src]

impl FromStr for Value[src]

type Err = ParserError

The associated error which can be returned from parsing.

impl Hash for Value[src]

impl Ord for Value[src]

impl PartialEq<Value> for Value[src]

impl PartialOrd<Value> for Value[src]

impl StructuralEq for Value[src]

impl StructuralPartialEq for Value[src]

impl Writeable for Value[src]

Auto Trait Implementations

impl RefUnwindSafe for Value

impl Send for Value

impl Sync for Value

impl Unpin for Value

impl UnwindSafe for Value

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> 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.