Skip to main content

FormattedStringExt

Trait FormattedStringExt 

Source
pub trait FormattedStringExt<'a> {
    // Required methods
    fn is_formatted(&self) -> bool;
    fn strip_formatting(self) -> Cow<'a, str>;
}
Expand description

An extension trait giving strings a function to strip IRC colors

Required Methods§

Source

fn is_formatted(&self) -> bool

Returns true if the string contains color, bold, underline or italics

Source

fn strip_formatting(self) -> Cow<'a, str>

Returns the string with all color, bold, underline and italics stripped

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FormattedStringExt<'static> for String

Source§

fn is_formatted(&self) -> bool

Source§

fn strip_formatting(self) -> Cow<'static, str>

Source§

impl<'a> FormattedStringExt<'a> for &'a str

Implementors§