Struct rust_icu_ucol::UCollator
source · [−]pub struct UCollator { /* private fields */ }
Implementations
sourceimpl UCollator
impl UCollator
sourcepub fn strcoll(&self, first: &UChar, second: &UChar) -> Ordering
pub fn strcoll(&self, first: &UChar, second: &UChar) -> Ordering
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
sourcepub fn get_sort_key(&self, source: &UChar) -> Vec<u8>
pub fn get_sort_key(&self, source: &UChar) -> Vec<u8>
Get a sort key for a string from this collator.
Returns a sort key.
Implements ucol_getSortKey
sourcepub fn strcoll_utf8(
&self,
first: impl AsRef<str>,
second: impl AsRef<str>
) -> Result<Ordering, Error>
pub fn strcoll_utf8(
&self,
first: impl AsRef<str>,
second: impl AsRef<str>
) -> Result<Ordering, Error>
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
sourcepub fn get_strength(&self) -> UCollationStrength
pub fn get_strength(&self) -> UCollationStrength
Implements ucol_getStrength
.
sourcepub fn set_strength(&mut self, strength: UCollationStrength)
pub fn set_strength(&mut self, strength: UCollationStrength)
Implements ucol_setStrength
sourcepub fn set_attribute(
&self,
attr: UColAttribute,
value: UColAttributeValue
) -> Result<(), Error>
pub fn set_attribute(
&self,
attr: UColAttribute,
value: UColAttributeValue
) -> Result<(), Error>
Implements $impl_name
.
sourcepub fn get_attribute(
&self,
attr: UColAttribute
) -> Result<UColAttributeValue, Error>
pub fn get_attribute(
&self,
attr: UColAttribute
) -> Result<UColAttributeValue, Error>
Implements $impl_name
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for UCollator
impl !Send for UCollator
impl !Sync for UCollator
impl Unpin for UCollator
impl UnwindSafe for UCollator
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more