# Module rustix::termios

source · [−]
Expand description

Terminal I/O stream operations.

## Enums

Action

`TC*` values for use with `tcflow`.

OptionalActions

`TCSA*` values for use with `tcsetattr`.

QueueSelector

`TC*` values for use with `tcflush`.

## Constants

B0

`B0`

B50

`B50`

B75

`B75`

B110

`B110`

B134

`B134`

B150

`B150`

B200

`B200`

B300

`B300`

B600

`B600`

B1200

`B1200`

B1800

`B1800`

B2400

`B2400`

B4800

`B4800`

B9600

`B9600`

B19200

`B19200`

B38400

`B38400`

B57600

`B57600`

B115200

`B115200`

B230400

`B230400`

B460800

`B460800`

B500000

`B500000`

B576000

`B576000`

B921600

`B921600`

B1000000

`B1000000`

B1152000

`B1152000`

B1500000

`B1500000`

B2000000

`B2000000`

B2500000

`B2500000`

B3000000

`B3000000`

B3500000

`B3500000`

B4000000

`B4000000`

BRKINT

`BRKINT`

BS0

`BS0`

BS1

`BS1`

BSDLY

`BSDLY`

CBAUD

`CBAUD`

CBAUDEX

`CBAUDEX`

CIBAUD

`CIBAUD`

CLOCAL

`CLOCAL`

CMSPAR

`CMSPAR`

CR0

`CR0`

CR1

`CR1`

CR2

`CR2`

CR3

`CR3`

CRDLY

`CRDLY`

CREAD

`CREAD`

CRTSCTS

`CRTSCTS`

CS5

`CS5`

CS6

`CS6`

CS7

`CS7`

CS8

`CS8`

CSIZE

`CSIZE`

CSTOPB

`CSTOPB`

ECHO

`ECHO`

ECHOCTL

`ECHOCTL`

ECHOE

`ECHOE`

ECHOK

`ECHOK`

ECHOKE

`ECHOKE`

ECHONL

`ECHONL`

ECHOPRT

`ECHOPRT`

EXTA

`EXTA`

EXTB

`EXTB`

EXTPROC

`EXTPROC`

FF0

`FF0`

FF1

`FF1`

FFDLY

`FFDLY`

FLUSHO

`FLUSHO`

HUPCL

`HUPCL`

ICANON

`ICANON`—A flag for the `c_lflag` field of `Termios` indicating canonical mode.

ICRNL

`ICRNL`

IEXTEN

`IEXTEN`

IGNBRK

`IGNBRK`

IGNCR

`IGNCR`

IGNPAR

`IGNPAR`

IMAXBEL

`IMAXBEL`

INLCR

`INLCR`

INPCK

`INPCK`

ISIG

`ISIG`

ISTRIP

`ISTRIP`

IUCLC

`IUCLC`

IUTF8

`IUTF8`

IXANY

`IXANY`

IXOFF

`IXOFF`

IXON

`IXON`

NL0

`NL0`

NL1

`NL1`

NLDLY

`NLDLY`

NOFLSH

`NOFLSH`

OCRNL

`OCRNL`

OFDEL

`OFDEL`

OFILL

`OFILL`

OLCUC

`OLCUC`

ONLCR

`ONLCR`

ONLRET

`ONLRET`

ONOCR

`ONOCR`

OPOST

`OPOST`

PARENB

`PARENB`

PARMRK

`PARMRK`

PARODD

`PARODD`

PENDIN

`PENDIN`

TAB0

`TAB0`

TAB1

`TAB1`

TAB2

`TAB2`

TAB3

`TAB3`

TABDLY

`TABDLY`

TOSTOP

`TOSTOP`

VDISCARD

`VDISCARD`

VEOF

`VEOF`

VEOL

`VEOL`

VEOL2

`VEOL2`

VERASE

`VERASE`

VINTR

`VINTR`

VKILL

`VKILL`

VLNEXT

`VLNEXT`

VMIN

`VMIN`

VQUIT

`VQUIT`

VREPRINT

`VREPRINT`

VSTART

`VSTART`

VSTOP

`VSTOP`

VSUSP

`VSUSP`

VSWTC

`VSWTC`

VT0

`VT0`

VT1

`VT1`

VTDLY

`VTDLY`

VTIME

`VTIME`

VWERASE

`VWERASE`

XCASE

`XCASE`

XTABS

`XTABS`

## Functions

cfgetispeed

`cfgetispeed(termios)`

cfgetospeed

`cfgetospeed(termios)`

cfmakeraw

`cfmakeraw(termios)`

cfsetispeed

`cfsetispeed(termios, speed)`

cfsetospeed

`cfsetospeed(termios, speed)`

cfsetspeed

`cfsetspeed(termios, speed)`

isatty

`isatty(fd)`—Tests whether a file descriptor refers to a terminal.

speed_value

Translate from a `Speed` code to a speed value `u32`.

tcdrain

`tcdrain(fd, duration)`—Wait until all pending output has been written.

tcflow

`tcflow(fd, action)`—Suspend or resume transmission or reception.

tcflush

`tcflush(fd, queue_selector)`—Wait until all pending output has been written.

tcgetattr

`tcgetattr(fd)`—Get terminal attributes.

tcgetpgrp

`tcgetpgrp(fd)`—Get the terminal foreground process group.

tcgetsid

`tcgetsid(fd)`—Return the session ID of the current session with `fd` as its controlling terminal.

tcgetwinsize

`tcgetwinsize(fd)`—Get the current terminal window size.

tcsendbreak

`tcsendbreak(fd, 0)`—Transmit zero-valued bits.

tcsetattr

`tcsetattr(fd)`—Set terminal attributes.

tcsetpgrp

`tcsetpgrp(fd, pid)`—Set the terminal foreground process group.

tcsetwinsize

`tcsetwinsize(fd)`—Set the current terminal window size.

## Type Definitions

Speed

`speed_t`—A return type for `cfsetspeed` and similar.

Tcflag

`tcflag_t`—A type for the flags fields of `Termios`.

Termios

`struct termios` for use with `tcgetattr`.

Winsize

`struct winsize` for use with `tcgetwinsize`.