Enum TermIoctlCmd

Source
#[repr(u32)]
pub enum TermIoctlCmd {
Show 16 variants TCGETS = 21_505, TCSETS = 21_506, TCSETSW = 21_507, TCSETSF = 21_508, TCGETA = 21_509, TCSETA = 21_510, TCSETAW = 21_511, TCSETAF = 21_512, TIOCGPGRP = 21_519, TIOCSPGRP = 21_520, TIOCGWINSZ = 21_523, TIOCSWINSZ = 21_524, FIONCLEX = 21_584, FIOCLEX = 21_585, FIONBIO = 21_537, RTCRDTIME = 2_149_871_625,
}
Expand description

Teletype 设备相关 ioctl 命令,用于控制终端(如串口、TTY)行为。

Variants§

§

TCGETS = 21_505

获取当前串口设置(termios 结构体)

§

TCSETS = 21_506

立即设置串口配置(termios 结构体)

§

TCSETSW = 21_507

等待输出缓冲区刷新后再设置串口配置

§

TCSETSF = 21_508

刷新输入输出缓冲区后设置串口配置

§

TCGETA = 21_509

获取当前串口设置(termio 结构体)

§

TCSETA = 21_510

立即设置串口配置(termio 结构体)

§

TCSETAW = 21_511

等待输出缓冲区刷新后设置串口配置

§

TCSETAF = 21_512

刷新输入输出缓冲区后设置串口配置

§

TIOCGPGRP = 21_519

获取当前终端的前台进程组 ID

§

TIOCSPGRP = 21_520

设置当前终端的前台进程组 ID

§

TIOCGWINSZ = 21_523

获取终端窗口大小(通常与 struct winsize 搭配)

§

TIOCSWINSZ = 21_524

设置终端窗口大小

§

FIONCLEX = 21_584

取消 close-on-exec 标志(在 exec 执行时文件描述符不会自动关闭)

§

FIOCLEX = 21_585

设置 close-on-exec 标志(在 exec 执行时自动关闭文件描述符)

§

FIONBIO = 21_537

设置非阻塞 I/O(rustc 编译器也会用这个 ioctl 命令控制 pipe 行为)

§

RTCRDTIME = 2_149_871_625

获取 RTC(实时时钟)的当前时间(用于 RTC 设备)

Trait Implementations§

Source§

impl Debug for TermIoctlCmd

Source§

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

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

impl PartialEq for TermIoctlCmd

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<u32> for TermIoctlCmd

Source§

type Error = TryFromPrimitiveError<TermIoctlCmd>

The type returned in the event of a conversion error.
Source§

fn try_from(number: u32) -> Result<Self, TryFromPrimitiveError<Self>>

Performs the conversion.
Source§

impl TryFromPrimitive for TermIoctlCmd

Source§

const NAME: &'static str = "TermIoctlCmd"

Source§

type Primitive = u32

Source§

type Error = TryFromPrimitiveError<TermIoctlCmd>

Source§

fn try_from_primitive( number: Self::Primitive, ) -> Result<Self, TryFromPrimitiveError<Self>>

Source§

impl Eq for TermIoctlCmd

Source§

impl StructuralPartialEq for TermIoctlCmd

Auto Trait Implementations§

§

impl Freeze for TermIoctlCmd

§

impl RefUnwindSafe for TermIoctlCmd

§

impl Send for TermIoctlCmd

§

impl Sync for TermIoctlCmd

§

impl Unpin for TermIoctlCmd

§

impl UnwindSafe for TermIoctlCmd

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.