A key used in a list of Fields
.
The key has to be a two ASCII characters long, with the first
character being alphabetic, and the second being a number.
use icu::locid::extensions::transform::Key;
let key1: Key = "k0".parse()
.expect("Failed to parse a Key.");
assert_eq!(key1.as_str(), "k0");
A constructor which takes a utf8 slice, parses it and
produces a well-formed Key
.
use icu::locid::extensions::transform::Key;
let key = Key::from_bytes(b"i0")
.expect("Parsing failed.");
assert_eq!(key, "i0");
A helper function for displaying
a Key
as a &
str
.
use icu::locid::extensions::transform::Key;
let key: Key = "s0".parse()
.expect("Parsing failed.");
assert_eq!(key.as_str(), "s0");
Notice
: For many use cases, such as comparison,
Key
implements PartialEq
<&
str
>
which allows for direct comparisons.
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The associated error which can be returned from parsing.
Parses a string s
to return a value of this type. 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
#[must_use]
pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
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, 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.