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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.