Trait aspasia::TextEvent

source ·
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§

source

fn unformatted_text(&self) -> Cow<'_, String>

Get text content with all formatting tags removed

Provided Methods§

source

fn strip_formatting(&mut self)

Remove all formatting tags from event text

source

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.

Implementors§