pub struct ControlSequence { /* private fields */ }
Expand description
A control sequence is a string of bit combinations starting with the control function CONTROL SEQUENCE INTRODUCER (CSI).
Followed by one or more bit combinations representing parameters, if any, and by one or more bit combinations identifying the control function.
To “execute” a control sequence you can print it or call the method exec
:
use coded_chars::control::ControlSequence;
let sequence = ControlSequence::new(&["1", "1"], "H");
print!("{}", sequence); // Prints \x1b[1;1H
// or
sequence.exec(); // Prints \x1b[1;1H
Almost every function from this crate return ControlSequences :
// This example is equivalent to the above example :
use coded_chars::cursor::set_position;
let sequence = set_position(1, 1); // Returns a ControlSequence
sequence.exec(); // Prints \x1b[1;1H
Implementations§
Trait Implementations§
Source§impl Clone for ControlSequence
impl Clone for ControlSequence
Source§fn clone(&self) -> ControlSequence
fn clone(&self) -> ControlSequence
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ControlSequence
impl RefUnwindSafe for ControlSequence
impl Send for ControlSequence
impl Sync for ControlSequence
impl Unpin for ControlSequence
impl UnwindSafe for ControlSequence
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