pub struct CqlshTableFormatter {
pub column_headers: Vec<String>,
pub rows: Vec<Vec<String>>,
pub show_row_count: bool,
pub color_support: bool,
}Expand description
Table formatter for cqlsh-compatible output
Fields§
§column_headers: Vec<String>§rows: Vec<Vec<String>>§show_row_count: bool§color_support: boolImplementations§
Source§impl CqlshTableFormatter
impl CqlshTableFormatter
Sourcepub fn set_headers(&mut self, headers: Vec<String>)
pub fn set_headers(&mut self, headers: Vec<String>)
Set column headers
Sourcepub fn from_sstable_entries(
&mut self,
entries: &[SSTableEntry],
table_name: &str,
)
pub fn from_sstable_entries( &mut self, entries: &[SSTableEntry], table_name: &str, )
Convert SSTable entries to formatted table
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
Get column count
Sourcepub fn format_as_json(&self) -> Value
pub fn format_as_json(&self) -> Value
Format as JSON for API compatibility
Sourcepub fn format_cell_value(&self, value: &str, column_name: &str) -> String
pub fn format_cell_value(&self, value: &str, column_name: &str) -> String
Apply data type specific formatting
Sourcepub fn set_color_support(&mut self, enabled: bool)
pub fn set_color_support(&mut self, enabled: bool)
Set color support
Sourcepub fn set_show_row_count(&mut self, show: bool)
pub fn set_show_row_count(&mut self, show: bool)
Enable/disable row count display
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CqlshTableFormatter
impl RefUnwindSafe for CqlshTableFormatter
impl Send for CqlshTableFormatter
impl Sync for CqlshTableFormatter
impl Unpin for CqlshTableFormatter
impl UnsafeUnpin for CqlshTableFormatter
impl UnwindSafe for CqlshTableFormatter
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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