Enum makeup::Ansi

source ·
pub enum Ansi {
Show 21 variants CursorPosition(u64, u64), CursorStyle(CursorStyle), CursorVisibility(CursorVisibility), CursorUp(u64), CursorDown(u64), CursorLeft(u64), CursorRight(u64), CursorNextLine(u64), CursorPreviousLine(u64), CursorHorizontalAbsolute(u64), SaveCursorPosition, RestoreCursorPosition, EraseInDisplay(DisplayEraseMode), EraseInLine(LineEraseMode), ScrollUp(u64), ScrollDown(u64), TerminalSize(u64, u64), TerminalTitle(String), TerminalForegroundColour(Colour), TerminalBackgroundColour(Colour), Sgr(Vec<SgrParameter>),
}
Expand description

ANSI escape sequences. Can be directly formatted into strings.

Variants§

§

CursorPosition(u64, u64)

Set the (x, y) cursor position.

§

CursorStyle(CursorStyle)

Set the cursor style.

§

CursorVisibility(CursorVisibility)

Set the cursor visibility.

§

CursorUp(u64)

Move the cursor up.

§

CursorDown(u64)

Move the cursor down.

§

CursorLeft(u64)

Move the cursor left.

§

CursorRight(u64)

Move the cursor right.

§

CursorNextLine(u64)

Move the cursor to the start of line count steps down.

§

CursorPreviousLine(u64)

Move the cursor to the start of line count steps up.

§

CursorHorizontalAbsolute(u64)

Move the cursor to the column x.

§

SaveCursorPosition

Save the current position of the cursor.

§

RestoreCursorPosition

Restore the position of the cursor.

§

EraseInDisplay(DisplayEraseMode)

Erase part of the current display.

§

EraseInLine(LineEraseMode)

Erase part of the current line.

§

ScrollUp(u64)

Scroll the display up.

§

ScrollDown(u64)

Scroll the display down.

§

TerminalSize(u64, u64)

Set the terminal size. This is not supported on Windows.

§

TerminalTitle(String)

Set the terminal title. This is not supported on Windows.

§

TerminalForegroundColour(Colour)

Set the terminal foreground colour. This is not supported on Windows.

§

TerminalBackgroundColour(Colour)

Set the terminal background colour. This is not supported on Windows.

§

Sgr(Vec<SgrParameter>)

Set attributes on the current terminal. This is not supported on Windows. See: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters

Implementations§

source§

impl Ansi

source

pub fn render(&self, f: &mut impl Write) -> Result<(), Report>

Render this ANSI escape sequence into the given Writeable.

Trait Implementations§

source§

impl Clone for Ansi

source§

fn clone(&self) -> Ansi

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Ansi

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Display for Ansi

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Hash for Ansi

source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Ansi

source§

fn cmp(&self, other: &Ansi) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Ansi

source§

fn eq(&self, other: &Ansi) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Ansi

source§

fn partial_cmp(&self, other: &Ansi) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Eq for Ansi

source§

impl StructuralEq for Ansi

source§

impl StructuralPartialEq for Ansi

Auto Trait Implementations§

§

impl RefUnwindSafe for Ansi

§

impl Send for Ansi

§

impl Sync for Ansi

§

impl Unpin for Ansi

§

impl UnwindSafe for Ansi

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> AsAny for T
where T: Any,

source§

fn as_any(&self) -> &(dyn Any + 'static)

source§

fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V