pub struct Columns<'a> { /* private fields */ }Expand description
Main crate structure, here goes all the logic.
Generates a column-separated string.
In the future I pretend to make columns mutable, that’s why I’m using Vecs instead of &[].
Implementations§
Source§impl<'a> Columns<'a>
impl<'a> Columns<'a>
Sourcepub fn make_columns(&self) -> String
pub fn make_columns(&self) -> String
Transforms a Columns struct into a String.
Used in Display implementation.
Sourcepub fn set_tabsize(self, tabsize: usize) -> Self
pub fn set_tabsize(self, tabsize: usize) -> Self
Sets tabsize manually.
Can be pretty wonky, so base_tabsize_in is recommended instead.
Sourcepub fn base_tabsize_in(self, column_number: usize) -> Self
pub fn base_tabsize_in(self, column_number: usize) -> Self
Bases tabsize in a single column, instead of checking every column and finding the largest line.
Example:
println!(
"{}",
columns::Columns::from(
vec![
vec!["a", "b", "c"],
vec!["big", "text", "that makes you annoyed"]
]
).base_tabsize_in(0) // Column numbers are count from 0
);Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Columns<'a>
impl<'a> RefUnwindSafe for Columns<'a>
impl<'a> Send for Columns<'a>
impl<'a> Sync for Columns<'a>
impl<'a> Unpin for Columns<'a>
impl<'a> UnwindSafe for Columns<'a>
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