[][src]Struct gh_emoji::Replacer

pub struct Replacer { /* fields omitted */ }

Replaces :emoji: in strings

let r = gh_emoji::Replacer::new();
let unicode_text = r.replace_all("Hello :cat:!");

Methods

impl Replacer[src]

pub fn new() -> Self[src]

There is some small setup cost

pub fn replace_all<'a>(&self, text: &'a str) -> Cow<'a, str>[src]

Replaces all occurrences of :emoji_names: in the string

It may return Cow::Borrowed if there were no emoji-like patterns in the string. Call .to_string() if you need String or .as_ref() to get &str.

Auto Trait Implementations

impl Unpin for Replacer

impl Sync for Replacer

impl Send for Replacer

impl !RefUnwindSafe for Replacer

impl UnwindSafe for Replacer

Blanket Implementations

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

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

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.

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.

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

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

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