pub struct Table<const W: usize, T> { /* private fields */ }Implementations§
Source§impl<const W: usize, T> Table<W, T>where
T: Cell,
impl<const W: usize, T> Table<W, T>where
T: Cell,
pub fn new(opts: TableOptions) -> Table<W, T>
pub fn with_opts(self, opts: TableOptions) -> Table<W, T>
pub fn size(&self, parent: Constraint) -> Size
pub fn divider(&mut self)
pub fn push(&mut self, row: [T; W])
pub fn header(&mut self, row: [T; W])
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl<const W: usize, T> Element for Table<W, T>
impl<const W: usize, T> Element for Table<W, T>
Source§fn size(&self, parent: Constraint) -> Size
fn size(&self, parent: Constraint) -> Size
Get the size of the element, in rows and columns.
Source§fn render(&self, parent: Constraint) -> Vec<Line>
fn render(&self, parent: Constraint) -> Vec<Line>
Render the element as lines of text that can be printed.
Source§fn columns(&self, parent: Constraint) -> usize
fn columns(&self, parent: Constraint) -> usize
Get the number of columns occupied by this element.
Source§fn rows(&self, parent: Constraint) -> usize
fn rows(&self, parent: Constraint) -> usize
Get the number of rows occupied by this element.
Source§fn write(&self, constraints: Constraint) -> Result<(), Error>where
Self: Sized,
fn write(&self, constraints: Constraint) -> Result<(), Error>where
Self: Sized,
Write using the given constraints to
stdout.Source§fn display(&self, constraints: Constraint) -> String
fn display(&self, constraints: Constraint) -> String
Return a string representation of this element.
Source§impl<const W: usize, T> Extend<[T; W]> for Table<W, T>where
T: Cell,
impl<const W: usize, T> Extend<[T; W]> for Table<W, T>where
T: Cell,
Source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = [T; W]>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = [T; W]>,
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Auto Trait Implementations§
impl<const W: usize, T> Freeze for Table<W, T>
impl<const W: usize, T> RefUnwindSafe for Table<W, T>where
T: RefUnwindSafe,
impl<const W: usize, T> Send for Table<W, T>where
T: Send,
impl<const W: usize, T> Sync for Table<W, T>where
T: Sync,
impl<const W: usize, T> Unpin for Table<W, T>where
T: Unpin,
impl<const W: usize, T> UnwindSafe for Table<W, T>where
T: UnwindSafe,
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more