#gui #ui

gui

A generic UI library/framework

17 unstable releases (6 breaking)

0.6.0 Nov 7, 2020
0.5.0 Mar 27, 2020
0.4.0 Sep 16, 2019
0.3.0 Mar 31, 2019
0.0.0 Mar 4, 2018

#39 in GUI

Download history 95/week @ 2020-11-06 25/week @ 2020-11-13 37/week @ 2020-11-20 30/week @ 2020-11-27 31/week @ 2020-12-04 7/week @ 2020-12-11 5/week @ 2020-12-18 25/week @ 2020-12-25 30/week @ 2021-01-01 41/week @ 2021-01-08 46/week @ 2021-01-15 14/week @ 2021-01-22 8/week @ 2021-01-29 17/week @ 2021-02-05 115/week @ 2021-02-12 7/week @ 2021-02-19

106 downloads per month
Used in 2 crates

GPL-3.0-or-later

53KB
793 lines

pipeline coverage crates.io Docs rustc

gui

gui (short for generic user interface) is a crate providing basic user interface functionality. It strives to be as independent as possible of the underlying system architecture. That is, it is compatible with windowing as well as terminal based systems and it does not rely on the specifics of any GUI toolkit.

Part of this story means that it is not an out-of-the-box replacement for your favorite user interface toolkit (think: GTK+, Qt, wxWidgets to name popular ones), but that it should be seen more as a building block, providing certain hooks and basic functionality typically seen in a UI. The infrastructure for dispatching events to widgets is an example. To make proper use of it, the functionality provided by this crate needs to be glued with the underlying system.

gui is used for exploring parts of the design space for user interface architecture using Rust. Design of UI systems in Rust is generally considered hard and to a large degree an unsolved problem, although there are various promising designs out there.

The crate uses Rust's async/await for ergonomic event handling and message passing between widgets and to the best of the author's knowledge, is the first doing so.

Features

  • completely independent of underlying architecture
    • generic over events and messages used
    • compatible with any rendering library
  • async/await based event handling and message passing support
  • no dependencies other than async-trait to work around current short comings in Rust

Status

The crate is under active development, and while its core has been reasonably stable for a while, changes should be anticipated in the future.

Given this current state, changes in API design are to be expected.

Example Usage

The notnow program is relying on the gui crate for the creation of its terminal based UI. The basic workings can be seen there.

Dependencies

~0.4–0.8MB
~20K SLoC