Crate ttygrid

Source
Expand description

ttygrid provides functionality for displaying table-ized text to users with appropriate padding and width management. With ttygrid, you merely need to feed it your data, some information about the precedence (called a “priority”) of each column, and it will automatically determine what to show to the user based on the available display width. See crate::grid! for more information.

Here is a demo to see the results in action.

It is not intended for streaming (aka, not tty) situations. It probably only works on unix right now too.

The demo example some basic capabilities and should be reviewed for understanding this library; as well as learning the macros.

Much of this library relies on the macros, not the types directly. Please review those for the most comprehensive documentation.

Macros§

add_line
add_line defines a crate::GridLine with crate::GridItems attached.
grid
grid defines a crate::TTYGrid full of headers, which are associated with lines.
header
header defines a crate::SafeGridHeader for use with the crate::TTYGrid.

Structs§

GridHeader
GridHeader encapsulates the properties of a header, such as priority and padding information. This is typically constructed by crate::header! and is not constructed directly.
GridItem
GridItem is the encapsulation of a piece of content. It is usually created by invoking crate::add_line! and is not instantiated directly.
GridLine
A collection of grid items. Usually instantiated by crate::add_line!.
HeaderList
HeaderList defines a list of headers. This is typically composed as a part of the process from crate::header! and crate::grid! and is not constructed directly.
TTYGrid
Usually constructed by crate::grid!, this is the outer object of the whole library, all things are held by it in some form. Please review the impl for methods which can be used to adjust the properties of the grid once created.

Type Aliases§

SafeGridHeader