pub struct ViewWidget<'a> { /* private fields */ }Expand description
A stateless Ratatui widget that draws an Urushi View.
The widget draws into the buffer passed to [Widget::render]. It does not
initialize a terminal, read events, or own terminal I/O. Text in the view is
plain; ANSI escape sequences are not interpreted inside a Ratatui buffer.
The target Rect supplies the width and height constraints for layout: the
view is resolved under those constraints before its cells are written. Its
flexible dimensions and overflow therefore follow the layout rules for the
target area instead of resolving at the intrinsic size and being cropped
afterward. Any part of the target outside the caller’s buffer is masked
separately during cell writing.
The widget keeps the cells and discards the anchors, so an anchor in the
view draws as the blanks it resolved to. A caller that needs them resolves
the view itself and reads ResolvedView::anchors: they belong to one
resolution, and resolving again here to hand them back would be a second
one.
Implementations§
Source§impl<'a> ViewWidget<'a>
impl<'a> ViewWidget<'a>
Sourcepub const fn cell_write_mode(self, mode: CellWriteMode) -> Self
pub const fn cell_write_mode(self, mode: CellWriteMode) -> Self
Selects how drawn cells combine with content already in the buffer.
Trait Implementations§
Source§impl<'a> Clone for ViewWidget<'a>
impl<'a> Clone for ViewWidget<'a>
Source§fn clone(&self) -> ViewWidget<'a>
fn clone(&self) -> ViewWidget<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for ViewWidget<'a>
impl<'a> Debug for ViewWidget<'a>
Source§impl Widget for &ViewWidget<'_>
impl Widget for &ViewWidget<'_>
Source§impl Widget for ViewWidget<'_>
impl Widget for ViewWidget<'_>
impl<'a> Copy for ViewWidget<'a>
Auto Trait Implementations§
impl<'a> Freeze for ViewWidget<'a>
impl<'a> !RefUnwindSafe for ViewWidget<'a>
impl<'a> Send for ViewWidget<'a>
impl<'a> Sync for ViewWidget<'a>
impl<'a> Unpin for ViewWidget<'a>
impl<'a> UnsafeUnpin for ViewWidget<'a>
impl<'a> !UnwindSafe for ViewWidget<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more