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 */ }
Available on crate feature termios only.
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 u8)

🔬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.