Struct rust_icu_ucol::UCollator[][src]

pub struct UCollator { /* fields omitted */ }

Implementations

impl UCollator[src]

pub fn strcoll(&self, first: &UChar, second: &UChar) -> Ordering[src]

Compares strings first and second according to the collation rules in this collator.

Returns Ordering::Less if first compares as less than second, and for other return codes respectively.

Implements ucol_strcoll

pub fn strcoll_utf8(
    &self,
    first: impl AsRef<str>,
    second: impl AsRef<str>
) -> Result<Ordering, Error>
[src]

Compares strings first and second according to the collation rules in this collator.

Returns Ordering::Less if first compares as less than second, and for other return codes respectively.

In contrast to UCollator::strcoll, this function requires no string conversions to compare two rust strings.

Implements ucol_strcoll Implements ucol_strcollUTF8

pub fn get_strength(&self) -> UCollationStrength[src]

Implements ucol_getStrength.

pub fn set_strength(&mut self, strength: UCollationStrength)[src]

Implements ucol_setStrength

pub fn set_attribute(
    &self,
    attr: UColAttribute,
    value: UColAttributeValue
) -> Result<(), Error>
[src]

Implements $impl_name.

pub fn get_attribute(
    &self,
    attr: UColAttribute
) -> Result<UColAttributeValue, Error>
[src]

Implements $impl_name.

Trait Implementations

impl Debug for UCollator[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Drop for UCollator[src]

fn drop(&mut self)[src]

Implements $impl_function_name.

impl TryFrom<&'_ str> for UCollator[src]

fn try_from(locale: &str) -> Result<UCollator, Self::Error>[src]

Makes a new collator from the supplied locale, e.g. en-US, or de@collation=phonebook.

Other examples:

  • el-u-kf-upper
  • el@colCaseFirst=upper

Implements ucol_open

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.