pub struct BorderChar { /* private fields */ }
Expand description
BorderChar
sets a char to a specific location on a horizontal line.
§Example
use tabled::{Table, style::{Style, BorderChar, Offset}, Modify, object::Rows};
let mut table = Table::new(["Hello World"]);
table
.with(Style::markdown())
.with(Modify::new(Rows::single(1))
.with(BorderChar::horizontal(':', Offset::Begin(0)))
.with(BorderChar::horizontal(':', Offset::End(0)))
.with(BorderChar::vertical('#', Offset::Begin(0)))
);
assert_eq!(
table.to_string(),
concat!(
"| &str |\n",
"|:-----------:|\n",
"# Hello World #",
),
);
Implementations§
Source§impl BorderChar
impl BorderChar
Sourcepub fn horizontal(c: char, offset: Offset) -> Self
pub fn horizontal(c: char, offset: Offset) -> Self
Creates a BorderChar
which overrides horizontal line.
Sourcepub fn vertical(c: char, offset: Offset) -> Self
pub fn vertical(c: char, offset: Offset) -> Self
Creates a BorderChar
which overrides vertical line.
Trait Implementations§
Source§impl<R> CellOption<R> for BorderCharwhere
R: Records,
impl<R> CellOption<R> for BorderCharwhere
R: Records,
Source§fn change_cell(&mut self, table: &mut Table<R>, entity: Entity)
fn change_cell(&mut self, table: &mut Table<R>, entity: Entity)
Modification function of a single cell.
Auto Trait Implementations§
impl Freeze for BorderChar
impl RefUnwindSafe for BorderChar
impl Send for BorderChar
impl Sync for BorderChar
impl Unpin for BorderChar
impl UnwindSafe for BorderChar
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