11 releases

0.2.4 Apr 15, 2023
0.2.3 Mar 9, 2022
0.2.2 Apr 23, 2020
0.2.1 Jul 14, 2019
0.1.3 Jul 19, 2018

#270 in Command-line interface

Download history 669/week @ 2023-12-18 370/week @ 2023-12-25 323/week @ 2024-01-01 826/week @ 2024-01-08 895/week @ 2024-01-15 1558/week @ 2024-01-22 955/week @ 2024-01-29 1608/week @ 2024-02-05 1506/week @ 2024-02-12 1555/week @ 2024-02-19 1460/week @ 2024-02-26 1199/week @ 2024-03-04 1888/week @ 2024-03-11 4068/week @ 2024-03-18 4102/week @ 2024-03-25 4418/week @ 2024-04-01

14,565 downloads per month
Used in 40 crates (4 directly)

MIT/Apache

215KB
5K SLoC

mortal

Concurrent cross-platform terminal interface, for Unix terminals and Windows console.

Provides a line-by-line terminal interface and a screen buffer interface.

Documentation

Building

To include mortal in your project, add the following to your Cargo.toml:

[dependencies]
mortal = "0.2"

And the following to your crate root:

extern crate mortal;

License

mortal is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.


lib.rs:

Platform-independent terminal interface

Two distinct interfaces to operating system terminal devices are provided, each abstracting over the differences between Unix terminals and Windows console.

The Terminal interface treats the terminal as a line-by-line output device. Methods exist to add color and style attributes to text, and to make relative movements of the cursor.

The Screen interface treats the entire terminal window as a drawable buffer. Methods exist to set the cursor position and to write text with color and style attributes.

The term_write! and term_writeln! macros provide a convenient interface to output attributes and formatted text to either a Terminal or Screen instance.

Concurrency

Each interface uses internal locking mechanisms to allow sharing of the terminal interface between threads while maintaining coherence of read/write operations.

See the documentation for Terminal and Screen for further details.

Dependencies

~4.5MB
~107K SLoC