rustix::termios

Struct Termios

source
#[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 */ }
Expand description

struct termios for use with tcgetattr and tcsetattr.

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

source

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.

source

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.

source

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.

source

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.

source

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.

source

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§

source§

impl Clone for Termios

source§

fn clone(&self) -> Termios

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 Termios

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 T
where 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 T
where T: Clone,

source§

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 T
where U: Into<T>,

source§

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 T
where U: TryFrom<T>,

source§

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.