pub struct TableLayout {
pub block: TableBlock,
pub col_widths: Vec<usize>,
}Expand description
Display-column widths for one TableBlock, measured on unconcealed
source cell content so widths stay stable as the cursor moves (inactive
rows conceal markers; per-row padding absorbs the difference and pipes
still align everywhere).
Fields§
§block: TableBlockThe block these widths were measured for.
col_widths: Vec<usize>Max trimmed content width per column (minimum 3, keeping the delimiter shape valid).
Implementations§
Source§impl TableLayout
impl TableLayout
Sourcepub fn build(buffer: &EditorBuffer, block: &TableBlock) -> Self
pub fn build(buffer: &EditorBuffer, block: &TableBlock) -> Self
Measures column widths for block from header, delimiter, and body rows.
Delimiter cells count so wide markers (:---:) still fit; the
delimiter has no concealment, so its width is always stable.
Trait Implementations§
Source§impl Clone for TableLayout
impl Clone for TableLayout
Source§fn clone(&self) -> TableLayout
fn clone(&self) -> TableLayout
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 TableLayout
impl Debug for TableLayout
impl Eq for TableLayout
Source§impl PartialEq for TableLayout
impl PartialEq for TableLayout
Source§fn eq(&self, other: &TableLayout) -> bool
fn eq(&self, other: &TableLayout) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TableLayout
Auto Trait Implementations§
impl Freeze for TableLayout
impl RefUnwindSafe for TableLayout
impl Send for TableLayout
impl Sync for TableLayout
impl Unpin for TableLayout
impl UnsafeUnpin for TableLayout
impl UnwindSafe for TableLayout
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