Giter Site home page Giter Site logo

rustty's Introduction

rustty: a terminal UI library

Build Status Crates.io Crates.io

Intro

Rustty is a terminal UI library that provides a simple, concise abstraction over an underlying terminal device.

Rustty is based on the concepts of cells and events. A terminal display is an array of cells, each holding a character and a set of foreground and background styles. Events are how a terminal communicates changes in its state; events are received from a terminal, processed, and pushed onto an input stream to be read and responded to.

Installation

Installation is simple, to use rustty, first add this to your Cargo.toml:

[dependencies]
rustty = "*"

Then, add this to your crate root:

extern crate rustty;

Concepts

The purpose of this section is to introduce and explain the main concepts of rustty and the decisions behind its design.

Terminal

The terminal representation can be thought of as such:

0-------------------------------cols (x)
|
|
|
|
|
|
|
|
rows (y)

Along the x-axis are the columns and along the y-axis are the rows. The upper-left corner is the origin, which begins at index (0, 0) and extends to (cols, rows). Each point (x, y) represents a single cell, which is the next topic.

Cells

A cell is a single point on a character display, representing a single character and its foreground and background styles.

Events

Events are how changes in a terminal's state are represented. A terminal has an associated event stream which acts much like a UNIX pipe, or a FIFO queue. When events occur they are pushed on to the back of the stream; when events are read they are taken from the front of the stream.

Usage Guide

Examples and usage suggestions can be found in the API documentation.

Contact

If you encounter any issues with the library or have suggestions, please report them with the issue tracker.

If you have any further questions, please don't hesitate to email me, and I respond as soon as I am able.

rustty's People

Contributors

cpjreynolds avatar jbschlosser avatar syntaf avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.