[go: up one dir, main page]

Module ratatui::backend

source ·
Expand description

This module provides the backend implementations for different terminal libraries. It defines the Backend trait which is used to abstract over the specific terminal library being used.

The following terminal libraries are supported:

  • Crossterm (with the crossterm feature)
  • Termion (with the termion feature)
  • Termwiz (with the termwiz feature)

Additionally, a TestBackend is provided for testing purposes.

Example

use ratatui::backend::{Backend, CrosstermBackend};

let buffer = std::io::stdout();
let mut backend = CrosstermBackend::new(buffer);
backend.clear()?;

Structs

  • A backend implementation using the crossterm crate.
  • A backend that uses the Termion library to draw content, manipulate the cursor, and clear the terminal screen.
  • Termwiz backend implementation for the Backend trait.
  • A backend used for the integration tests.

Enums

  • Enum representing the different types of clearing operations that can be performed on the terminal screen.

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.