pub enum TextElement {
Text(String),
NewLine,
Teletext(TeletextControl),
Open(OpenControl),
Reserved(u8),
}Expand description
A part of the decoded Text Field of a subtitle.
Characters between control codes are combined into a single TextElement::Text. The
unused space code (8Fh) ends the text and is not included.
§Example
use ebustl_parser::{Color, TeletextControl, TextElement};
let stl = ebustl_parser::parse_stl_from_file("stls/test.stl").unwrap();
assert_eq!(
vec![
TextElement::Teletext(TeletextControl::DoubleHeight),
TextElement::Teletext(TeletextControl::AlphaColor(Color::Cyan)),
TextElement::Teletext(TeletextControl::StartBox),
TextElement::Teletext(TeletextControl::StartBox),
TextElement::Text("au pied de la statue de la Liberté.".to_string()),
TextElement::Teletext(TeletextControl::EndBox),
TextElement::NewLine,
],
stl.ttis[2].text_elements()
);Variants§
Text(String)
Characters, decoded with the Character Code Table
NewLine
CR/LF (8Ah), starting the next row
Teletext(TeletextControl)
A teletext control code (00h-1Fh), used for teletext subtitles. Teletext control codes occupy a character position on screen.
Open(OpenControl)
A control code for open subtitles (80h-85h)
Reserved(u8)
A code reserved for future use (86h-89h, 8Bh-8Eh and 90h-9Fh)
Trait Implementations§
Source§impl Clone for TextElement
impl Clone for TextElement
Source§impl Debug for TextElement
impl Debug for TextElement
impl Eq for TextElement
Source§impl PartialEq for TextElement
impl PartialEq for TextElement
impl StructuralPartialEq for TextElement
Auto Trait Implementations§
impl Freeze for TextElement
impl RefUnwindSafe for TextElement
impl Send for TextElement
impl Sync for TextElement
impl Unpin for TextElement
impl UnsafeUnpin for TextElement
impl UnwindSafe for TextElement
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more