Trait fractal::utils::string::PangoStrMutExt
source · pub trait PangoStrMutExt {
// Required methods
fn append_link_opening_tag(&mut self, uri: impl AsRef<str>);
fn maybe_append_emote_name(&mut self, name: &mut Option<&str>);
fn maybe_append_mention(
&mut self,
uri: impl TryInto<MatrixIdUri>,
room: &Room,
) -> Option<Pill>;
fn append_and_replace_at_room(
&mut self,
s: &str,
room: &Room,
) -> Option<Pill>;
}
Expand description
Common extensions for adding Pango markup to mutable strings.
Required Methods§
sourcefn append_link_opening_tag(&mut self, uri: impl AsRef<str>)
fn append_link_opening_tag(&mut self, uri: impl AsRef<str>)
Append the opening Pango markup link tag of the given URI parts.
The URI is also used as a title, so users can preview the link on hover.
sourcefn maybe_append_emote_name(&mut self, name: &mut Option<&str>)
fn maybe_append_emote_name(&mut self, name: &mut Option<&str>)
Append the given emote’s sender name and consumes it, if it is set.
sourcefn maybe_append_mention(
&mut self,
uri: impl TryInto<MatrixIdUri>,
room: &Room,
) -> Option<Pill>
fn maybe_append_mention( &mut self, uri: impl TryInto<MatrixIdUri>, room: &Room, ) -> Option<Pill>
Append the given URI as a mention, if it is one.
Returns the created Pill
, it the URI was added as a mention.
Object Safety§
This trait is not object safe.