[−][src]Struct translit::Transliterator
The Transliterator
struct allows for the transliteration
of the string of characters of Cyrillic alphabet UTF-8 to Latin alphabet
and back.
Methods
impl Transliterator
[src]
pub fn new(custom_rules: CharsMapping) -> Self
[src]
Creates a new Transliterator
with transliteration table
Examples
use translit::{Transliterator, CharsMapping}; let table: CharsMapping = [ ("а", "a"), ("с", "s"), ("д", "d"), ("ф", "f"), ].iter() .cloned() .collect(); let trasliterator = Transliterator::new(table); let res = trasliterator.convert("фасад", false); assert_eq!("fasad", res);
pub fn convert(&self, src: &str, invert: bool) -> String
[src]
Transliterate input string.
Trait Implementations
impl ToLatin for Transliterator
[src]
fn to_latin(&self, src: &str) -> String
[src]
The wrapper on the method convert
of transliteration in the Latin alphabet
impl FromLatin for Transliterator
[src]
fn from_latin(&self, src: &str) -> String
[src]
The wrapper on the method convert
of transliteration from the Latin alphabet
Auto Trait Implementations
impl Send for Transliterator
impl Sync for Transliterator
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,