Struct rust_icu_utrans::UTransliterator[][src]

pub struct UTransliterator { /* fields omitted */ }
Expand description

Rust wrapper for the ICU UTransliterator type.

Implementations

impl UTransliterator[src]

pub fn get_ids() -> Result<Enumeration, Error>[src]

Returns an enumeration containing the identifiers of all available transliterators.

Implements utrans_openIDs.

pub fn register(trans: Self) -> Result<(), Error>[src]

Consumes trans and registers it with the underlying ICU system. A transliterator that has been registered with the system can be retrieved by calling new with its identifier.

Implements utrans_register.

pub fn new(
    id: &str,
    rules: Option<&str>,
    dir: UTransDirection
) -> Result<Self, Error>
[src]

If rules are given, creates a new transliterator with rules and identifier. Otherwise, returns the ICU system transliterator with the given identifier.

Implements utrans_openU.

pub fn new_ustring(
    id: &UChar,
    rules: Option<&UChar>,
    dir: UTransDirection
) -> Result<Self, Error>
[src]

Implements utrans_openU.

pub fn get_id(&self) -> Result<String, Error>[src]

Returns the identifier for this transliterator.

Implements utrans_getUnicodeID.

pub fn inverse(&self) -> Result<Self, Error>[src]

Returns the inverse of this transliterator, provided that the inverse has been registered with the underlying ICU system, i.e., a built-in ICU transliterator or one registered with register.

Implements utrans_openInverse.

pub fn to_rules(&self, escape_unprintable: bool) -> Result<String, Error>[src]

Returns a rules string for this transliterator in the same format expected by new.

Implements utrans_toRules.

pub fn set_filter(&mut self, pattern: Option<&str>) -> Result<(), Error>[src]

Apply a filter to this transliterator, causing certain characters to pass through untouched. The filter is formatted as a UnicodeSet string. If the filter is None, then any previously-applied filter is cleared.

Implements utrans_setFilter.

pub fn set_filter_ustring(
    &mut self,
    pattern: Option<&UChar>
) -> Result<(), Error>
[src]

Implements utrans_setFilter.

pub fn transliterate(&self, text: &str) -> Result<String, Error>[src]

Returns a string containing the transliterated text.

Implements utrans_transUChars.

pub fn transliterate_ustring(&self, text: &UChar) -> Result<UChar, Error>[src]

Implements utrans_transUChars.

pub fn unregister(id: &str) -> Result<(), Error>[src]

Unregister a transliterator from the underlying ICU system.

Implements utrans_unregisterID.

Trait Implementations

impl Clone for UTransliterator[src]

fn clone(&self) -> Self[src]

Implements utrans_clone.

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for UTransliterator[src]

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

Formats the value using the given formatter. Read more

impl Drop for UTransliterator[src]

fn drop(&mut self)[src]

Implements $impl_function_name.

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.