pub struct TabSize(/* private fields */);
Expand description
Set a tab size.
The size is used in order to calculate width correctly.
Default value is 4 (basically 1 ‘\t’ equals 4 spaces).
IMPORTANT: The tab character might be not present in output, it might be replaced by spaces.
§Example
use tabled::{Table, settings::formatting::TabSize};
let text = "Some\ttext\t\twith \\tabs";
let mut table = Table::new([text]);
table.with(TabSize::new(4));
assert_eq!(
table.to_string(),
"+--------------------------------+\n\
| &str |\n\
+--------------------------------+\n\
| Some text with \\tabs |\n\
+--------------------------------+"
)
Implementations§
Trait Implementations§
Source§impl<R, D, C> TableOption<R, C, D> for TabSize
impl<R, D, C> TableOption<R, C, D> for TabSize
Auto Trait Implementations§
impl Freeze for TabSize
impl RefUnwindSafe for TabSize
impl Send for TabSize
impl Sync for TabSize
impl Unpin for TabSize
impl UnwindSafe for TabSize
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