struct Columns {
char_width_tenths: u16,
}
Expand description
Fractional number of columns, used here to account for Node::StyledText
being used to intentionally reduce the size of many “helper” pieces of text,
at least for the HTML output (while this may lead to a less consistently
formatted plaintext output, making good use of width is far more important
for the HTML output, especially when used with multiversion
tables).
Fields§
§char_width_tenths: u16
As our font-size
control granularity is in multiples of 0.1em
,
the overall width of a line should end up a multiple of 0.1ch
,
i.e. we’re counting tenths of a column’s width at the default font size.
Implementations§
source§impl Columns
impl Columns
const ZERO: Self = _
fn text_width(text: &str) -> Self
fn maybe_styled_text_width(text: &str, style: Option<&Styles>) -> Self
fn saturating_add(self, other: Self) -> Self
fn saturating_sub(self, other: Self) -> Self
Trait Implementations§
source§impl Ord for Columns
impl Ord for Columns
source§impl PartialEq for Columns
impl PartialEq for Columns
source§impl PartialOrd for Columns
impl PartialOrd for Columns
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Columns
impl Eq for Columns
impl StructuralPartialEq for Columns
Auto Trait Implementations§
impl RefUnwindSafe for Columns
impl Send for Columns
impl Sync for Columns
impl Unpin for Columns
impl UnwindSafe for Columns
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.