Enum ansi_parser::Output
source · pub enum Output<'a> {
TextBlock(&'a str),
Escape(AnsiSequence),
}
Expand description
This is a library for parsing ANSI escape sequences. Currently all the basic escape sequences are implemented:
- Cursor Position
- Cursor {Up, Down, Forward, Backward}
- Cursor {Save, Restore}
- Erase Display
- Erase Line
- Set Graphics mode
- Set and Reset Text Mode
This is done through a pulldown type parser, where an iterator is exposed. This essentially turns all of the ANSI sequences into enums and splits the string at every location that there was an ANSI Sequence. This is what is outputted by the parsing iterator. Each block contains either straight-up text, or simply an ANSI escape sequence.
Variants§
TextBlock(&'a str)
Escape(AnsiSequence)
Trait Implementations§
source§impl<'a> PartialEq for Output<'a>
impl<'a> PartialEq for Output<'a>
impl<'a> StructuralPartialEq for Output<'a>
Auto Trait Implementations§
impl<'a> Freeze for Output<'a>
impl<'a> RefUnwindSafe for Output<'a>
impl<'a> Send for Output<'a>
impl<'a> Sync for Output<'a>
impl<'a> Unpin for Output<'a>
impl<'a> UnwindSafe for Output<'a>
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