pub enum ControlCode {
Show 34 variants Null, StartOfHeading, StartOfText, EndOfText, EndOfTransmission, Enquiry, Acknowledge, Bell, Backspace, HorizontalTabulation, LineFeed, VerticalTabulation, FormFeed, CarriageReturn, ShiftOut, ShiftIn, DataLinkEscape, DeviceControl1, DeviceControl2, DeviceControl3, DeviceControl4, NegativeAcknowledge, SynchronousIdle, EndOfTransmissionBlock, Cancel, EndOfMedium, Substitute, Escape, FileSeparator, GroupSeparator, RecordSeparator, UnitSeparator, Space, Delete,
}
Expand description

ControlCode represents the standard ASCII control codes wiki

Variants§

§

Null

Often used as a string terminator, especially in the programming language C.

§

StartOfHeading

In message transmission, delimits the start of a message header.

§

StartOfText

First character of message text, and may be used to terminate the message heading.

§

EndOfText

Often used as a “break” character (Ctrl-C) to interrupt or terminate a program or process.

§

EndOfTransmission

Often used on Unix to indicate end-of-file on a terminal (Ctrl-D).

§

Enquiry

Signal intended to trigger a response at the receiving end, to see if it is still present.

§

Acknowledge

Response to an Enquiry, or an indication of successful receipt of a message.

§

Bell

Used for a beep on systems that didn’t have a physical bell.

§

Backspace

Move the cursor one position leftwards. On input, this may delete the character to the left of the cursor.

§

HorizontalTabulation

Position to the next character tab stop.

§

LineFeed

On Unix, used to mark end-of-line. In DOS, Windows, and various network standards, LF is used following CR as part of the end-of-line mark.

§

VerticalTabulation

Position the form at the next line tab stop.

§

FormFeed

It appears in some common plain text files as a page break character.

§

CarriageReturn

Originally used to move the cursor to column zero while staying on the same line.

§

ShiftOut

Switch to an alternative character set.

§

ShiftIn

Return to regular character set after ShiftOut.

§

DataLinkEscape

May cause a limited number of contiguously following octets to be interpreted in some different way.

§

DeviceControl1

A control code which is reserved for device control.

§

DeviceControl2

A control code which is reserved for device control.

§

DeviceControl3

A control code which is reserved for device control.

§

DeviceControl4

A control code which is reserved for device control.

§

NegativeAcknowledge

In multipoint systems, the NAK is used as the not-ready reply to a poll.

§

SynchronousIdle

Used in synchronous transmission systems to provide a signal from which synchronous correction may be achieved.

§

EndOfTransmissionBlock

Indicates the end of a transmission block of data.

§

Cancel

Indicates that the data preceding it are in error or are to be disregarded.

§

EndOfMedium

May mark the end of the used portion of the physical medium.

§

Substitute

Sometimes used to indicate the end of file, both when typing on the terminal and in text files stored on disk.

§

Escape

The Esc key on the keyboard will cause this character to be sent on most systems. In systems based on ISO/IEC 2022, even if another set of C0 control codes are used, this octet is required to always represent the escape character.

§

FileSeparator

Can be used as delimiters to mark fields of data structures. Also it used for hierarchical levels; FS == level 4

§

GroupSeparator

It used for hierarchical levels; GS == level 3

§

RecordSeparator

It used for hierarchical levels; RS == level 2

§

UnitSeparator

It used for hierarchical levels; US == level 1

§

Space

Space is a graphic character. It causes the active position to be advanced by one character position.

§

Delete

Usually called backspace on modern machines, and does not correspond to the PC delete key.

Implementations§

source§

impl ControlCode

source

pub const NUL: ControlCode = ControlCode::Null

source

pub const SOH: ControlCode = ControlCode::StartOfHeading

source

pub const STX: ControlCode = ControlCode::StartOfText

source

pub const ETX: ControlCode = ControlCode::EndOfText

source

pub const EOT: ControlCode = ControlCode::EndOfTransmission

source

pub const ENQ: ControlCode = ControlCode::Enquiry

source

pub const ACK: ControlCode = ControlCode::Acknowledge

source

pub const BEL: ControlCode = ControlCode::Bell

source

pub const BS: ControlCode = ControlCode::Backspace

source

pub const HT: ControlCode = ControlCode::HorizontalTabulation

source

pub const LF: ControlCode = ControlCode::LineFeed

source

pub const VT: ControlCode = ControlCode::VerticalTabulation

source

pub const FF: ControlCode = ControlCode::FormFeed

source

pub const CR: ControlCode = ControlCode::CarriageReturn

source

pub const SO: ControlCode = ControlCode::ShiftOut

source

pub const SI: ControlCode = ControlCode::ShiftIn

source

pub const DLE: ControlCode = ControlCode::DataLinkEscape

source

pub const DC1: ControlCode = ControlCode::DeviceControl1

source

pub const DC2: ControlCode = ControlCode::DeviceControl2

source

pub const DC3: ControlCode = ControlCode::DeviceControl3

source

pub const DC4: ControlCode = ControlCode::DeviceControl4

source

pub const NAK: ControlCode = ControlCode::NegativeAcknowledge

source

pub const SYN: ControlCode = ControlCode::SynchronousIdle

source

pub const ETB: ControlCode = ControlCode::EndOfTransmissionBlock

source

pub const CAN: ControlCode = ControlCode::Cancel

source

pub const EM: ControlCode = ControlCode::EndOfMedium

source

pub const SUB: ControlCode = ControlCode::Substitute

source

pub const ESC: ControlCode = ControlCode::Escape

source

pub const FS: ControlCode = ControlCode::FileSeparator

source

pub const GS: ControlCode = ControlCode::GroupSeparator

source

pub const RS: ControlCode = ControlCode::RecordSeparator

source

pub const US: ControlCode = ControlCode::UnitSeparator

source

pub const SP: ControlCode = ControlCode::Space

source

pub const DEL: ControlCode = ControlCode::Delete

Trait Implementations§

source§

impl AsRef<[u8]> for ControlCode

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<str> for ControlCode

source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for ControlCode

source§

fn clone(&self) -> ControlCode

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 ControlCode

source§

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

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

impl From<ControlCode> for u8

source§

fn from(val: ControlCode) -> Self

Converts to this type from the input type.
source§

impl PartialEq<ControlCode> for ControlCode

source§

fn eq(&self, other: &ControlCode) -> 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 TryFrom<&str> for ControlCode

§

type Error = ()

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

fn try_from(c: &str) -> Result<ControlCode, ()>

Performs the conversion.
source§

impl TryFrom<char> for ControlCode

§

type Error = ()

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

fn try_from(c: char) -> Result<ControlCode, ()>

Performs the conversion.
source§

impl Copy for ControlCode

source§

impl Eq for ControlCode

source§

impl StructuralEq for ControlCode

source§

impl StructuralPartialEq for ControlCode

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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, U> TryFrom<U> for Twhere 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 Twhere 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.