pub struct TuiTestBackend { /* private fields */ }Expand description
TUI Test Backend for capturing frames
Provides a text grid and frame capture functionality for testing terminal UIs. Uses TextGrid instead of ratatui::Buffer for zero external dependencies.
Implementations§
Source§impl TuiTestBackend
impl TuiTestBackend
Sourcepub fn new(width: u16, height: u16) -> Self
pub fn new(width: u16, height: u16) -> Self
Create a new test backend with the given dimensions
Sourcepub fn capture_frame(&mut self) -> TuiFrame
pub fn capture_frame(&mut self) -> TuiFrame
Capture the current frame
Sourcepub fn current_frame(&self) -> TuiFrame
pub fn current_frame(&self) -> TuiFrame
Get the current frame without storing it
Sourcepub fn frame_count(&self) -> usize
pub fn frame_count(&self) -> usize
Get the number of captured frames
Sourcepub fn write_text(&mut self, x: u16, y: u16, text: &str)
pub fn write_text(&mut self, x: u16, y: u16, text: &str)
Write text at a position (for testing)
Sourcepub fn write_lines(&mut self, x: u16, y: u16, lines: &[&str])
pub fn write_lines(&mut self, x: u16, y: u16, lines: &[&str])
Write multiple lines starting at a position
Trait Implementations§
Source§impl Debug for TuiTestBackend
impl Debug for TuiTestBackend
Auto Trait Implementations§
impl Freeze for TuiTestBackend
impl RefUnwindSafe for TuiTestBackend
impl Send for TuiTestBackend
impl Sync for TuiTestBackend
impl Unpin for TuiTestBackend
impl UnsafeUnpin for TuiTestBackend
impl UnwindSafe for TuiTestBackend
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().