Enum expectrl::ControlCode
source · 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
impl ControlCode
sourcepub const NUL: ControlCode = ControlCode::Null
pub const NUL: ControlCode = ControlCode::Null
sourcepub const SOH: ControlCode = ControlCode::StartOfHeading
pub const SOH: ControlCode = ControlCode::StartOfHeading
sourcepub const STX: ControlCode = ControlCode::StartOfText
pub const STX: ControlCode = ControlCode::StartOfText
sourcepub const ETX: ControlCode = ControlCode::EndOfText
pub const ETX: ControlCode = ControlCode::EndOfText
sourcepub const EOT: ControlCode = ControlCode::EndOfTransmission
pub const EOT: ControlCode = ControlCode::EndOfTransmission
sourcepub const ENQ: ControlCode = ControlCode::Enquiry
pub const ENQ: ControlCode = ControlCode::Enquiry
sourcepub const ACK: ControlCode = ControlCode::Acknowledge
pub const ACK: ControlCode = ControlCode::Acknowledge
sourcepub const BEL: ControlCode = ControlCode::Bell
pub const BEL: ControlCode = ControlCode::Bell
sourcepub const BS: ControlCode = ControlCode::Backspace
pub const BS: ControlCode = ControlCode::Backspace
sourcepub const HT: ControlCode = ControlCode::HorizontalTabulation
pub const HT: ControlCode = ControlCode::HorizontalTabulation
sourcepub const LF: ControlCode = ControlCode::LineFeed
pub const LF: ControlCode = ControlCode::LineFeed
sourcepub const VT: ControlCode = ControlCode::VerticalTabulation
pub const VT: ControlCode = ControlCode::VerticalTabulation
sourcepub const FF: ControlCode = ControlCode::FormFeed
pub const FF: ControlCode = ControlCode::FormFeed
sourcepub const CR: ControlCode = ControlCode::CarriageReturn
pub const CR: ControlCode = ControlCode::CarriageReturn
sourcepub const SO: ControlCode = ControlCode::ShiftOut
pub const SO: ControlCode = ControlCode::ShiftOut
sourcepub const SI: ControlCode = ControlCode::ShiftIn
pub const SI: ControlCode = ControlCode::ShiftIn
sourcepub const DLE: ControlCode = ControlCode::DataLinkEscape
pub const DLE: ControlCode = ControlCode::DataLinkEscape
sourcepub const DC1: ControlCode = ControlCode::DeviceControl1
pub const DC1: ControlCode = ControlCode::DeviceControl1
sourcepub const DC2: ControlCode = ControlCode::DeviceControl2
pub const DC2: ControlCode = ControlCode::DeviceControl2
sourcepub const DC3: ControlCode = ControlCode::DeviceControl3
pub const DC3: ControlCode = ControlCode::DeviceControl3
sourcepub const DC4: ControlCode = ControlCode::DeviceControl4
pub const DC4: ControlCode = ControlCode::DeviceControl4
sourcepub const NAK: ControlCode = ControlCode::NegativeAcknowledge
pub const NAK: ControlCode = ControlCode::NegativeAcknowledge
sourcepub const SYN: ControlCode = ControlCode::SynchronousIdle
pub const SYN: ControlCode = ControlCode::SynchronousIdle
sourcepub const ETB: ControlCode = ControlCode::EndOfTransmissionBlock
pub const ETB: ControlCode = ControlCode::EndOfTransmissionBlock
sourcepub const CAN: ControlCode = ControlCode::Cancel
pub const CAN: ControlCode = ControlCode::Cancel
sourcepub const EM: ControlCode = ControlCode::EndOfMedium
pub const EM: ControlCode = ControlCode::EndOfMedium
sourcepub const SUB: ControlCode = ControlCode::Substitute
pub const SUB: ControlCode = ControlCode::Substitute
sourcepub const ESC: ControlCode = ControlCode::Escape
pub const ESC: ControlCode = ControlCode::Escape
sourcepub const FS: ControlCode = ControlCode::FileSeparator
pub const FS: ControlCode = ControlCode::FileSeparator
sourcepub const GS: ControlCode = ControlCode::GroupSeparator
pub const GS: ControlCode = ControlCode::GroupSeparator
sourcepub const RS: ControlCode = ControlCode::RecordSeparator
pub const RS: ControlCode = ControlCode::RecordSeparator
sourcepub const US: ControlCode = ControlCode::UnitSeparator
pub const US: ControlCode = ControlCode::UnitSeparator
sourcepub const SP: ControlCode = ControlCode::Space
pub const SP: ControlCode = ControlCode::Space
sourcepub const DEL: ControlCode = ControlCode::Delete
pub const DEL: ControlCode = ControlCode::Delete
Trait Implementations§
source§impl AsRef<[u8]> for ControlCode
impl AsRef<[u8]> for ControlCode
source§impl AsRef<str> for ControlCode
impl AsRef<str> for ControlCode
source§impl Clone for ControlCode
impl Clone for ControlCode
source§fn clone(&self) -> ControlCode
fn clone(&self) -> ControlCode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ControlCode
impl Debug for ControlCode
source§impl From<ControlCode> for u8
impl From<ControlCode> for u8
source§fn from(val: ControlCode) -> Self
fn from(val: ControlCode) -> Self
source§impl PartialEq<ControlCode> for ControlCode
impl PartialEq<ControlCode> for ControlCode
source§fn eq(&self, other: &ControlCode) -> bool
fn eq(&self, other: &ControlCode) -> bool
self
and other
values to be equal, and is used
by ==
.