pub trait TextEvent: TextEventInterface {
// Required method
fn unformatted_text(&self) -> Cow<'_, String>;
// Provided methods
fn strip_formatting(&mut self) { ... }
fn as_plaintext(&self) -> Cow<'_, String> { ... }
}
Expand description
Trait offering helper functions for textual subtitle events
Required Methods§
sourcefn unformatted_text(&self) -> Cow<'_, String>
fn unformatted_text(&self) -> Cow<'_, String>
Get text content with all formatting tags removed
Provided Methods§
sourcefn strip_formatting(&mut self)
fn strip_formatting(&mut self)
Remove all formatting tags from event text
sourcefn as_plaintext(&self) -> Cow<'_, String>
fn as_plaintext(&self) -> Cow<'_, String>
Get text in plaintext, without formatting and with no character escapes.
As an example, this differs from unformatted_text()
for SubStation files,
where \N
is converted to an actual newline character, \n
.