Module tuirealm::tui::prelude

source ·
Expand description

A prelude for conveniently writing applications using this library.

use ratatui::prelude::*;
Run

Aside from the main types that are used in the library, this prelude also re-exports several modules to make it easy to qualify types that would otherwise collide. E.g.:

use ratatui::{prelude::*, widgets::*};

#[derive(Debug, Default, PartialEq, Eq)]
struct Line;

assert_eq!(Line::default(), Line);
assert_eq!(text::Line::default(), ratatui::text::Line::from(vec![]));
Run

Structs§

  • A buffer that maps to the desired content of the terminal after the draw call
  • CompletedFrame represents the state of the terminal after all changes performed in the last Terminal::draw call have been applied. Therefore, it is only valid until the next call to Terminal::draw.
  • A Backend implementation that uses Crossterm to render to the terminal.
  • A consistent view into the terminal state for rendering a single frame.
  • A layout is a set of constraints that can be applied to a given area to split it into smaller ones.
  • A line of text, consisting of one or more Spans.
  • A wrapper around a string that is masked when displayed.
  • Modifier changes the way a piece of text is displayed.
  • A Rectangular area.
  • Represents a part of a line that is contiguous and where all characters share the same style.
  • Style lets you control the main characteristics of the displayed elements.
  • An interface to interact and draw Frames on the user’s terminal.
  • Options to pass to Terminal::with_options
  • A string split over multiple lines where each line is composed of several clusters, each with their own style.

Enums§

  • ANSI Color
  • A constraint that defines the size of a layout element.
  • Marker to use when plotting data points
  • Represents the viewport of the terminal. The viewport is the area of the terminal that is currently visible to the user. It can be either fullscreen, inline or fixed.

Traits§

  • The Backend trait provides an abstraction over different terminal libraries. It defines the methods required to draw content, manipulate the cursor, and clear the terminal screen.
  • An extension trait for Block that provides some convenience methods.
  • A StatefulWidget is a widget that can take advantage of some local state to remember things between two draw calls.
  • A trait for objects that have a Style.
  • An extension trait for styling objects.
  • A Widget is a type that can be drawn on a Buffer in a given Rect.