Skip to main content

Termios

Struct Termios 

Source
#[repr(C)]
pub struct Termios { pub c_iflag: u32, pub c_oflag: u32, pub c_cflag: u32, pub c_lflag: u32, pub c_line: u8, pub c_cc: [u8; 19], }
Expand description

Attributs d’un terminal — image ABI de struct termios (<asm-generic>).

#[repr(C)], disposition identique x86_64/aarch64. Champs bruts (compatibles kernel) lus/écrits via accesseurs typés. À échanger avec le kernel par les ioctls de air-sys-syscall::terminal.

Fields§

§c_iflag: u32

c_iflag — drapeaux d’entrée (brut).

§c_oflag: u32

c_oflag — drapeaux de sortie (brut).

§c_cflag: u32

c_cflag — drapeaux de contrôle (brut, inclut la vitesse CBAUD).

§c_lflag: u32

c_lflag — drapeaux locaux (brut).

§c_line: u8

c_line — discipline de ligne.

§c_cc: [u8; 19]

c_cc — caractères de contrôle (indexés par ControlChar).

Implementations§

Source§

impl Termios

Source

pub const fn zeroed() -> Self

Image toute-à-zéro (pour recevoir un TCGETS).

Source

pub const fn input_flags(&self) -> InputFlags

Drapeaux d’entrée typés. Les bits inconnus sont conservés (from_bits_retain).

Source

pub const fn output_flags(&self) -> OutputFlags

Drapeaux de sortie typés.

Source

pub const fn control_flags(&self) -> ControlFlags

Drapeaux de contrôle typés (hors bits de taille/vitesse).

Source

pub const fn local_flags(&self) -> LocalFlags

Drapeaux locaux typés.

Source

pub const fn set_input_flags(&mut self, flags: InputFlags)

Positionne les drapeaux d’entrée (remplace c_iflag).

Source

pub const fn set_output_flags(&mut self, flags: OutputFlags)

Positionne les drapeaux de sortie.

Source

pub const fn set_control_flags(&mut self, flags: ControlFlags)

Positionne les drapeaux de contrôle en préservant taille et vitesse (les bits CSIZE/CBAUD de c_cflag ne sont pas touchés).

Source

pub const fn set_local_flags(&mut self, flags: LocalFlags)

Positionne les drapeaux locaux.

Source

pub const fn char_size(&self) -> CharSize

Taille de caractère (CSIZE).

Source

pub const fn set_char_size(&mut self, size: CharSize)

Positionne la taille de caractère (CSIZE).

Source

pub const fn output_speed(&self) -> BaudRate

Vitesse encodée dans c_cflag (entrée et sortie partagent CBAUD sur Linux classique).

Source

pub const fn input_speed(&self) -> BaudRate

Vitesse d’entrée (identique à la sortie en termios classique Linux).

Source

pub const fn set_speed(&mut self, baud: BaudRate)

Positionne la vitesse (les bits CBAUD|CBAUDEX de c_cflag).

Source

pub const fn control_char(&self, which: ControlChar) -> u8

Lit un caractère de contrôle (c_cc[idx]).

Source

pub const fn set_control_char(&mut self, which: ControlChar, value: u8)

Positionne un caractère de contrôle (c_cc[idx]).

Trait Implementations§

Source§

impl Clone for Termios

Source§

fn clone(&self) -> Termios

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Termios

Source§

impl Debug for Termios

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for Termios

Source§

impl PartialEq for Termios

Source§

fn eq(&self, other: &Termios) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Termios

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.