Struct tty::LineDiscipline
source · pub struct LineDiscipline { /* private fields */ }
Expand description
A TTY line discipline.
The line discipline can be configured based on what application is using the
slave end. Most applications should use the sane
setting,
which handles line editing and echoing to the terminal. Applications that
require more control over the display should use the raw
setting.
The line discipline’s behaviour is documented in terms of Linux termios
flags. For more information, visit the cfmakeraw
documentation.
The line discipline prepends a carriage return to all line feeds on output.
This behaviour is equivalent to ONLCR
on Linux.
Implementations§
source§impl LineDiscipline
impl LineDiscipline
sourcepub fn set_sane(&self)
pub fn set_sane(&self)
Resets the line discipline to sane defaults.
This is equivalent to:
discipline.set_echo(true);
discipline.set_canonical(true);
sourcepub fn set_raw(&self)
pub fn set_raw(&self)
Sets the line discipline to raw mode.
This is equivalent to:
discipline.set_echo(false);
discipline.set_canonical(false);
pub fn echo(&self) -> bool
sourcepub fn set_echo(&self, echo: bool)
pub fn set_echo(&self, echo: bool)
Sets the echo flag.
This is equivalent to ECHO | ECHOE | ECHOCTL
on Linux.
sourcepub fn canonical(&self) -> bool
pub fn canonical(&self) -> bool
Sets the line discipline to canonical mode.
This is equivalent to ICANON | ICRNL
on Linux.
pub fn event_receiver(&self) -> Receiver<Event>
pub fn clear_events(&self)
sourcepub fn set_canonical(&self, canonical: bool)
pub fn set_canonical(&self, canonical: bool)
Sets the canonical flag.
This is equivalent to ICANON
on Linux.