pub struct TuiSnapshot {
pub width: u16,
pub height: u16,
pub cells: Vec<TuiCell>,
pub metadata: HashMap<String, String>,
}Expand description
Snapshot of TUI state for comparison.
Fields§
§width: u16Width.
height: u16Height.
cells: Vec<TuiCell>Cell data.
metadata: HashMap<String, String>Metadata (data values used, timestamps, etc.).
Implementations§
Source§impl TuiSnapshot
impl TuiSnapshot
Sourcepub fn load(path: &str) -> Result<Self, SnapshotError>
pub fn load(path: &str) -> Result<Self, SnapshotError>
Load snapshot from file.
Sourcepub fn parse(content: &str) -> Result<Self, SnapshotError>
pub fn parse(content: &str) -> Result<Self, SnapshotError>
Parse snapshot from string.
Sourcepub fn with_metadata(self, key: &str, value: &str) -> Self
pub fn with_metadata(self, key: &str, value: &str) -> Self
Set metadata value.
Sourcepub fn diff(&self, other: &TuiSnapshot) -> SnapshotDiff
pub fn diff(&self, other: &TuiSnapshot) -> SnapshotDiff
Compare with another snapshot.
Trait Implementations§
Source§impl Clone for TuiSnapshot
impl Clone for TuiSnapshot
Source§fn clone(&self) -> TuiSnapshot
fn clone(&self) -> TuiSnapshot
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TuiSnapshot
impl RefUnwindSafe for TuiSnapshot
impl Send for TuiSnapshot
impl Sync for TuiSnapshot
impl Unpin for TuiSnapshot
impl UnwindSafe for TuiSnapshot
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