Crates.io | grid_ui |
lib.rs | grid_ui |
version | 0.1.1 |
source | src |
created_at | 2021-09-29 16:27:19.208792 |
updated_at | 2021-09-30 04:19:21.267411 |
description | A Rust library for building a terminal-based UI with multiple elements, without hassle. |
homepage | |
repository | https://github.com/thea0032/grid_ui |
max_upload_size | |
id | 458191 |
size | 72,178 |
This is a lightweight library for more complicated CLIs, with multiple elements. It's designed to make separating multiple UI elements easier.
It's also designed to be versatile. With rust's trait interface, you can make it output from any CLI API, even though it was designed with crossterm in mind.
The prelude contains everything you can use (which isn't much).
I recommend you look at the documentation instead. Here's a short summary of what each structure does:
Alignment: An enum that's used for input.
DividerStrategy: An enum that's used to decide where text is placed inside a DrawProcess.
Frame: A structure that's used to represent the entire terminal, and "saves" dimension data.
SplitStrategy: A structure that's used to decide how grids are split apart.
Grid: A structure that represents a section of a terminal.
Action: An enum that's used to represent either moving the cursor or drawing.
Handler: A trait for structures that can translate actions into output.
SafeHandler: A trait for handlers that don't return errors.
OutToString: A handler that writes text out to a string without regards for location.
StringBuffer: A handler that writes text onto a vector of strings with regards for location.
DrawProcess: Represents a chunk of the terminal that has been "activated". Text can be added and then printed.
FormatError: Represents a problem with formatting. Currently only returned when there's no space for text.
TrimStrategy: A trait for structures that can translate text into trimmed text (text that fits a DrawProcess).
Ignore: A TrimStrategy that ignores whether or not text can fit. Just useful for debug and example purposes.
Split: A TrimStrategy that splits text into multiple lines if it doesn't fit.
Truncate: A TrimStrategy that removes all text that doesn't fit.
TrimmedText: The output of a TrimStrategy.
Should be completed.
This project is licensed under the MIT license.
(LICENSE-MIT or http://opensource.org/licenses/MIT)
v 0.1.1: Updated DrawProcess to add clear function. Fixed bug in documentation where a removed function was called.
v 0.1.0: Initial commit