pub struct BorderText<'a> { /* private fields */ }
Expand description
BorderText
writes a custom text on a border.
§Example
use tabled::{Table, BorderText};
let mut table = Table::new(["Hello World"]);
table
.with(BorderText::first("+-.table"));
assert_eq!(
table.to_string(),
"+-.table------+\n\
| &str |\n\
+-------------+\n\
| Hello World |\n\
+-------------+"
);
Implementations§
Source§impl<'a> BorderText<'a>
impl<'a> BorderText<'a>
Sourcepub fn new<S>(line: usize, text: S) -> Self
pub fn new<S>(line: usize, text: S) -> Self
Creates a BorderText
instance.
Lines are numbered from 0 to the count_rows
included
(line >= 0 && line <= count_rows
).
Sourcepub fn first<S>(text: S) -> Self
pub fn first<S>(text: S) -> Self
Creates a BorderText
instance for a top line.
Sourcepub fn last<S>(text: S) -> Self
pub fn last<S>(text: S) -> Self
Creates a BorderText
instance for a bottom line.
Trait Implementations§
Source§impl<'a> Debug for BorderText<'a>
impl<'a> Debug for BorderText<'a>
Source§impl<'a, R> TableOption<R> for BorderText<'a>where
R: Records,
impl<'a, R> TableOption<R> for BorderText<'a>where
R: Records,
Auto Trait Implementations§
impl<'a> Freeze for BorderText<'a>
impl<'a> RefUnwindSafe for BorderText<'a>
impl<'a> Send for BorderText<'a>
impl<'a> Sync for BorderText<'a>
impl<'a> Unpin for BorderText<'a>
impl<'a> UnwindSafe for BorderText<'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