pub struct TerminalSnapshot { /* private fields */ }Expand description
Terminal snapshot for testing.
Implementations§
Source§impl TerminalSnapshot
impl TerminalSnapshot
Sourcepub fn from_string(text: &str, width: u16, height: u16) -> Self
pub fn from_string(text: &str, width: u16, height: u16) -> Self
Create snapshot from a string (for testing).
Sourcepub fn dimensions(&self) -> (u16, u16)
pub fn dimensions(&self) -> (u16, u16)
Get snapshot dimensions.
Sourcepub fn contains_all(&self, texts: &[&str]) -> bool
pub fn contains_all(&self, texts: &[&str]) -> bool
Check if snapshot contains all texts.
Sourcepub fn contains_any(&self, texts: &[&str]) -> bool
pub fn contains_any(&self, texts: &[&str]) -> bool
Check if snapshot contains any of the texts.
Sourcepub fn count_char(&self, ch: char) -> usize
pub fn count_char(&self, ch: char) -> usize
Count occurrences of a character.
Trait Implementations§
Source§impl Clone for TerminalSnapshot
impl Clone for TerminalSnapshot
Source§fn clone(&self) -> TerminalSnapshot
fn clone(&self) -> TerminalSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TerminalSnapshot
impl Debug for TerminalSnapshot
Auto Trait Implementations§
impl Freeze for TerminalSnapshot
impl RefUnwindSafe for TerminalSnapshot
impl Send for TerminalSnapshot
impl Sync for TerminalSnapshot
impl Unpin for TerminalSnapshot
impl UnsafeUnpin for TerminalSnapshot
impl UnwindSafe for TerminalSnapshot
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> 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>
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 more