Crate rat_salsa

Crate rat_salsa 

Source
Expand description

semver stable crates.io Documentation License License

§rat-salsa 2

Runs an application event-loop for ratatui and crossterm.

It can

All incoming events are converted to an application defined event-type, and are distributed by calling an event-handler function. This function returns a control-flow which dictates further actions.

§Changes

Changes

§Book

link

§Companion Crates

  • rat-widget widget library. Incorporates everything below, but each crate can be used on its own too.

    Foundational crates

    • rat-event Defines the primitives for event-handling.
    • rat-cursor Defines just one trait to propagate the required screen cursor position.
    • rat-focus Primitives for focus-handling.
    • rat-reloc Relocate widgets after rendering. Needed support for view-like widgets.
    • rat-scrolled Utility widgets for scrolling.
    • rat-popup Utility widget to help with popups.
    • rat-dialog Stacks windows/dialogs above the main application. experimental

    Crates for specific widgets

    • rat-ftable table. uses traits to render your data, and renders only the visible cells. this makes rendering effectively O(1) in regard to the number of rows.
    • rat-menu Menu widgets.
    • rat-text Text/Value input widgets.
    • rat-markdown Extension for TextArea for markdown. experimental

    And my 10ct on theming.

    • rat-theme2 Color-palettes and widget styles.
    • rat-theme4 Latest iteration. Move to a map of things.
      • better text-color support
      • support for deriving themes by modifying existing ones.

§Example

The examples directory contains some examples

There are some templates too

  • minimal.rs: Minimal application with a menubar and statusbar.
  • nominal.rs: Minimal application, but using subcomponents.
  • dialog.rs: Minimal application, using dialog windows.

image

Modules§

dialog_stack
A stack of modal dialog windows.
event
Event types.
mock
Provides dummy implementations for some functions.
poll
Event sources.
tasks
Types used for both future tasks and thread tasks.
terminal
rat-salsa’s own Terminal trait to hide some details.
timer
Support for timers.

Structs§

RunConfig
Captures some parameters for crate::run_tui().
SalsaAppContext
Application context for event handling.

Enums§

Control
Result enum for event handling.

Traits§

SalsaContext
This trait gives access to all facilities built into rat-salsa.
TryAsMut
A version of AsMut<T> that can fail.
TryAsRef
A version of AsRef<T> that can fail.
TypedContainer
A trait for types that can hold values of different types.

Functions§

run_tui
Run the event-loop