Struct gh_emoji::Replacer

source ·
pub struct Replacer { /* private fields */ }
Expand description

Replaces :emoji: in strings

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

Implementations

There is some small setup cost

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

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.