#[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 */
}
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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Termios
impl RefUnwindSafe for Termios
impl Send for Termios
impl Sync for Termios
impl Unpin for Termios
impl UnwindSafe for Termios
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)