[−][src]Struct rust_icu_uloc::ULoc
A representation of a Unicode locale.
For the time being, only basic conversion and methods are in fact implemented.
To get basic validation when creating a locale, use
for_language_tag
with a Unicode BCP-47 locale ID.
Implementations
impl ULoc
[src]
pub fn language(&self) -> Option<String>
[src]
Implements uloc_getLanguage
.
pub fn script(&self) -> Option<String>
[src]
Implements uloc_getScript
.
pub fn country(&self) -> Option<String>
[src]
Implements uloc_getCountry
.
pub fn variant(&self) -> Option<String>
[src]
Implements uloc_getVariant
.
pub fn canonicalize(&self) -> Result<ULoc, Error>
[src]
Implements uloc_canonicalize
from ICU4C.
pub fn add_likely_subtags(&self) -> Result<ULoc, Error>
[src]
Implements uloc_addLikelySubtags
from ICU4C.
pub fn minimize_subtags(&self) -> Result<ULoc, Error>
[src]
Implements uloc_minimizeSubtags
from ICU4C.
pub fn to_language_tag(&self, strict: bool) -> Result<String, Error>
[src]
Implements uloc_toLanguageTag
from ICU4C.
pub fn keywords(&self) -> impl Iterator<Item = String>
[src]
Implements uloc_openKeywords()
from ICU4C.
pub fn unicode_keywords(&self) -> impl Iterator<Item = String>
[src]
Implements icu::Locale::getUnicodeKeywords()
from the C++ API.
pub fn keyword_value(&self, keyword: &str) -> Result<Option<String>, Error>
[src]
Implements uloc_getKeywordValue()
from ICU4C.
pub fn unicode_keyword_value(
&self,
unicode_keyword: &str
) -> Result<Option<String>, Error>
[src]
&self,
unicode_keyword: &str
) -> Result<Option<String>, Error>
Implements icu::Locale::getUnicodeKeywordValue()
from ICU4C.
pub fn label(&self) -> &str
[src]
Returns the current label of this locale.
pub fn as_c_str(&self) -> CString
[src]
Returns the current locale name as a C string.
pub fn for_language_tag(tag: &str) -> Result<ULoc, Error>
[src]
Implements uloc_forLanguageTag
from ICU4C.
Trait Implementations
impl Clone for ULoc
[src]
impl Debug for ULoc
[src]
impl Display for ULoc
[src]
Implement the Display trait to convert the ULoc into string for display.
The string for display and string serialization happen to be the same for ULoc.
impl Eq for ULoc
[src]
impl Hash for ULoc
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Locale for ULoc
[src]
Marker implementation for ULoc.
impl Ord for ULoc
[src]
This implementation is based on ULocale.compareTo from ICU4J. See https://github.com/unicode-org/icu/blob/master/icu4j/main/classes/core/src/com/ibm/icu/util/ULocale.java
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<ULoc> for ULoc
[src]
impl PartialOrd<ULoc> for ULoc
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for ULoc
[src]
impl StructuralPartialEq for ULoc
[src]
impl<'_> TryFrom<&'_ CStr> for ULoc
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(s: &CStr) -> Result<Self, Self::Error>
[src]
Creates a new ULoc
from a borrowed C string.
impl<'_> TryFrom<&'_ str> for ULoc
[src]
Auto Trait Implementations
impl RefUnwindSafe for ULoc
impl Send for ULoc
impl Sync for ULoc
impl Unpin for ULoc
impl UnwindSafe for ULoc
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,