#[repr(C)]pub struct Termios {
pub input_modes: InputModes,
pub output_modes: OutputModes,
pub control_modes: ControlModes,
pub local_modes: LocalModes,
pub line_discipline: cc_t,
pub special_codes: SpecialCodes,
/* private fields */
}
termios
only.Fields§
§input_modes: InputModes
How is input interpreted?
output_modes: OutputModes
How is output translated?
control_modes: ControlModes
Low-level configuration flags.
local_modes: LocalModes
High-level configuration flags.
line_discipline: cc_t
Line discipline.
special_codes: SpecialCodes
How are various special control codes handled?
Implementations§
Source§impl Termios
impl Termios
Sourcepub fn make_raw(&mut self)
pub fn make_raw(&mut self)
cfmakeraw(self)
—Set a Termios
value to the settings for “raw” mode.
In raw mode, input is available a byte at a time, echoing is disabled, and special terminal input and output codes are disabled.
Sourcepub fn input_speed(&self) -> u32
pub fn input_speed(&self) -> u32
Return the input communication speed.
Unlike the c_ispeed
field in glibc and others, this returns the
integer value of the speed, rather than the B*
encoded constant
value.
Sourcepub fn output_speed(&self) -> u32
pub fn output_speed(&self) -> u32
Return the output communication speed.
Unlike the c_ospeed
field in glibc and others, this returns the
arbitrary integer value of the speed, rather than the B*
encoded
constant value.
Sourcepub fn set_speed(&mut self, new_speed: u32) -> Result<()>
pub fn set_speed(&mut self, new_speed: u32) -> Result<()>
Set the input and output communication speeds.
Unlike the c_ispeed
and c_ospeed
fields in glibc and others, this
takes the arbitrary integer value of the speed, rather than the B*
encoded constant value. Not all implementations support all integer
values; use the constants in the speed
module for likely-supported
speeds.
Sourcepub fn set_input_speed(&mut self, new_speed: u32) -> Result<()>
pub fn set_input_speed(&mut self, new_speed: u32) -> Result<()>
Set the input communication speed.
Unlike the c_ispeed
field in glibc and others, this takes the
arbitrary integer value of the speed, rather than the B*
encoded
constant value. Not all implementations support all integer values; use
the constants in the speed
module for known-supported speeds.
On some platforms, changing the input speed changes the output speed to the same speed.
Sourcepub fn set_output_speed(&mut self, new_speed: u32) -> Result<()>
pub fn set_output_speed(&mut self, new_speed: u32) -> Result<()>
Set the output communication speed.
Unlike the c_ospeed
field in glibc and others, this takes the
arbitrary integer value of the speed, rather than the B*
encoded
constant value. Not all implementations support all integer values; use
the constants in the speed
module for known-supported speeds.
On some platforms, changing the output speed changes the input speed to the same speed.