pub struct Control { /* private fields */ }Expand description
A renderable that inserts terminal control codes.
Mirrors rich.control.Control. Construct it via the factory methods
(Control::clear, [Control::move], …) or Control::new with an
explicit list of codes, which are concatenated in order.
Implementations§
Source§impl Control
impl Control
Sourcepub fn new(codes: &[ControlType]) -> Self
pub fn new(codes: &[ControlType]) -> Self
Build a control from a sequence of codes, rendered end to end.
Sourcepub fn move_(x: i32, y: i32) -> Self
pub fn move_(x: i32, y: i32) -> Self
Move the cursor relative to its current position (x columns, y rows;
positive is right/down). Port of Control.move.
Sourcepub fn move_to_column(x: u32, y: i32) -> Self
pub fn move_to_column(x: u32, y: i32) -> Self
Move to a zero-based column, optionally offset the row by y. Port of
Control.move_to_column.
Sourcepub fn move_to(x: u32, y: u32) -> Self
pub fn move_to(x: u32, y: u32) -> Self
Move the cursor to an absolute zero-based (x, y) position.
Sourcepub fn show_cursor(show: bool) -> Self
pub fn show_cursor(show: bool) -> Self
Show or hide the cursor.
Sourcepub fn alt_screen(enable: bool) -> Self
pub fn alt_screen(enable: bool) -> Self
Enable or disable the terminal’s alternate screen buffer.
Trait Implementations§
Source§impl Renderable for Control
impl Renderable for Control
fn rich_render( &self, _console: &Console, _options: &ConsoleOptions, ) -> Vec<Segment>
Source§fn measure(&self, _console: &Console, options: &ConsoleOptions) -> Measurement
fn measure(&self, _console: &Console, options: &ConsoleOptions) -> Measurement
The
(minimum, maximum) cell width this renderable wants. The default
assumes the renderable fills the available width (e.g. Panel, Table);
Text overrides it with its content width so the top-level print path can
shrink to fit. Port of __rich_measure__ / Measurement.get.Auto Trait Implementations§
impl Freeze for Control
impl RefUnwindSafe for Control
impl Send for Control
impl Sync for Control
impl Unpin for Control
impl UnsafeUnpin for Control
impl UnwindSafe for Control
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