pub struct DebugTableBuilder { /* private fields */ }Expand description
Builder for constructing debug tables
§Example
use tui_dispatch_core::debug::{DebugTableBuilder, DebugTableRow};
let table = DebugTableBuilder::new()
.section("Connection")
.entry("host", "localhost")
.entry("port", "6379")
.section("Status")
.entry("connected", "true")
.finish("Connection Info");
assert_eq!(table.title, "Connection Info");
assert_eq!(table.rows.len(), 5);Implementations§
Source§impl DebugTableBuilder
impl DebugTableBuilder
Sourcepub fn entry(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn entry(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add a key-value entry
Sourcepub fn push_section(&mut self, title: impl Into<String>)
pub fn push_section(&mut self, title: impl Into<String>)
Add a section header (mutable reference version)
Sourcepub fn push_entry(&mut self, key: impl Into<String>, value: impl Into<String>)
pub fn push_entry(&mut self, key: impl Into<String>, value: impl Into<String>)
Add a key-value entry (mutable reference version)
Sourcepub fn cell_preview(self, preview: CellPreview) -> Self
pub fn cell_preview(self, preview: CellPreview) -> Self
Set the cell preview for inspect overlays
Sourcepub fn set_cell_preview(&mut self, preview: CellPreview)
pub fn set_cell_preview(&mut self, preview: CellPreview)
Set the cell preview (mutable reference version)
Sourcepub fn finish(self, title: impl Into<String>) -> DebugTableOverlay
pub fn finish(self, title: impl Into<String>) -> DebugTableOverlay
Build the final table overlay with the given title
Sourcepub fn finish_inspect(self, title: impl Into<String>) -> DebugOverlay
pub fn finish_inspect(self, title: impl Into<String>) -> DebugOverlay
Build as an inspect overlay
Sourcepub fn finish_state(self, title: impl Into<String>) -> DebugOverlay
pub fn finish_state(self, title: impl Into<String>) -> DebugOverlay
Build as a state overlay
Trait Implementations§
Source§impl Debug for DebugTableBuilder
impl Debug for DebugTableBuilder
Source§impl Default for DebugTableBuilder
impl Default for DebugTableBuilder
Source§fn default() -> DebugTableBuilder
fn default() -> DebugTableBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DebugTableBuilder
impl RefUnwindSafe for DebugTableBuilder
impl Send for DebugTableBuilder
impl Sync for DebugTableBuilder
impl Unpin for DebugTableBuilder
impl UnwindSafe for DebugTableBuilder
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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