Termios Rust Bindings
The termios
crate provides safe bindings for the Rust programming language to the terminal I/O
interface implemented by
Unix operating systems. The safe bindings are a small wrapper around the raw C functions, which
converts integer return values to std::io::Result
to indicate success or failure.
Dependencies
In order to use the termios
crate, you must have a native libc
library that implements the
termios API. This should be available on any Unix operating system. This library contains the
termios definitions for the following platforms:
- Linux (x86_64, armv6l)
- Android (x86)
- OS X (x86_64)
- FreeBSD (amd64)
- OpenBSD (amd64)
- DragonFly BSD (x86_64)
Usage
Add termios
as a dependency in Cargo.toml
:
[]
= "0.3"
Import the termios
crate and any symbols needed from termios
. You may also need
std::os::unix::io::RawFd
for file descriptors and std::io::Result
to propagate errors.
extern crate termios;
use io;
use RawFd;
use *;
Contributors
License
Copyright © 2015 David Cuddeback
Distributed under the MIT License.