Skip to main content

urushi_adapter_ratatui/
lib.rs

1//! Optional Ratatui integration for Urushi.
2//!
3//! The adapter converts Urushi styles and resolved views into Ratatui
4//! representations. Stateless widgets write into a buffer the caller owns.
5//!
6//! Two entry points share one cell-writing path. [`ViewWidget`] and
7//! [`RatatuiWidget`] serve a plain Ratatui application drawing into a `Rect`
8//! it already owns; they resolve the view and discard everything but the
9//! cells. A caller-owned Ratatui renderer that also needs the resolution
10//! resolves under [`available`] and writes the result with [`draw_resolved`].
11//! A caller filling a sized anchor can use
12//! [`anchor_placement`] to translate its complete logical rectangle and
13//! accumulated visible intersection into a destination and source offset.
14
15mod style;
16mod widget;
17
18pub use style::RatatuiStyle;
19pub use widget::{
20    CellWriteMode, RatatuiAnchor, RatatuiStyleExt, RatatuiWidget, ViewWidget, anchor_placement,
21    available, draw_resolved, draw_resolved_with_mode,
22};