[−][src]Struct gh_emoji::Replacer
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]
U: From<T>,
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> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,