term_model::ansi

Enum Mode

Source
pub enum Mode {
Show 17 variants CursorKeys = 1, DECCOLM = 3, Insert = 4, Origin = 6, LineWrap = 7, BlinkingCursor = 12, LineFeedNewLine = 20, ShowCursor = 25, ReportMouseClicks = 1_000, ReportCellMouseMotion = 1_002, ReportAllMouseMotion = 1_003, ReportFocusInOut = 1_004, Utf8Mouse = 1_005, SgrMouse = 1_006, AlternateScroll = 1_007, SwapScreenAndSetRestoreCursor = 1_049, BracketedPaste = 2_004,
}
Expand description

Terminal modes

Variants§

§

CursorKeys = 1

?1

§

DECCOLM = 3

Select 80 or 132 columns per page

CSI ? 3 h -> set 132 column font CSI ? 3 l -> reset 80 column font

Additionally,

  • set margins to default positions
  • erases all data in page memory
  • resets DECLRMM to unavailable
  • clears data from the status line (if set to host-writable)
§

Insert = 4

IRM Insert Mode

NB should be part of non-private mode enum

  • CSI 4 h change to insert mode
  • CSI 4 l reset to replacement mode
§

Origin = 6

?6

§

LineWrap = 7

?7

§

BlinkingCursor = 12

?12

§

LineFeedNewLine = 20

20

NB This is actually a private mode. We should consider adding a second enumeration for public/private modesets.

§

ShowCursor = 25

?25

§

ReportMouseClicks = 1_000

?1000

§

ReportCellMouseMotion = 1_002

?1002

§

ReportAllMouseMotion = 1_003

?1003

§

ReportFocusInOut = 1_004

?1004

§

Utf8Mouse = 1_005

?1005

§

SgrMouse = 1_006

?1006

§

AlternateScroll = 1_007

?1007

§

SwapScreenAndSetRestoreCursor = 1_049

?1049

§

BracketedPaste = 2_004

?2004

Implementations§

Source§

impl Mode

Source

pub fn from_primitive(intermediate: Option<&u8>, num: i64) -> Option<Mode>

Create mode from a primitive

TODO lots of unhandled values..

Trait Implementations§

Source§

impl Debug for Mode

Source§

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

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

impl PartialEq for Mode

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Mode

Source§

impl StructuralPartialEq for Mode

Auto Trait Implementations§

§

impl Freeze for Mode

§

impl RefUnwindSafe for Mode

§

impl Send for Mode

§

impl Sync for Mode

§

impl Unpin for Mode

§

impl UnwindSafe for Mode

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.