Struct rckive_genpdf::elements::TableLayoutRow
source · pub struct TableLayoutRow<'a> { /* private fields */ }
Expand description
A row of a table layout.
This is a helper struct for populating a TableLayout
. After you have added all elements
to the row using push_element
or element
, you can append the row to the table
layout by calling push
.
Examples
With setters:
use rckive_genpdf::elements;
let mut table = elements::TableLayout::new(vec![1, 1]);
let mut row = table.row();
row.push_element(elements::Paragraph::new("Cell 1"));
row.push_element(elements::Paragraph::new("Cell 2"));
row.push().expect("Invalid table row");
Chained:
use rckive_genpdf::elements;
let table = elements::TableLayout::new(vec![1, 1])
.row()
.element(elements::Paragraph::new("Cell 1"))
.element(elements::Paragraph::new("Cell 2"))
.push()
.expect("Invalid table row");
Implementations§
source§impl<'a> TableLayoutRow<'a>
impl<'a> TableLayoutRow<'a>
sourcepub fn push_element<E: IntoBoxedElement>(&mut self, element: E)
pub fn push_element<E: IntoBoxedElement>(&mut self, element: E)
Adds the given element to this row.
sourcepub fn element<E: IntoBoxedElement>(self, element: E) -> Self
pub fn element<E: IntoBoxedElement>(self, element: E) -> Self
Adds the given element to this row and returns the row.
Trait Implementations§
source§impl<'a, E: IntoBoxedElement> Extend<E> for TableLayoutRow<'a>
impl<'a, E: IntoBoxedElement> Extend<E> for TableLayoutRow<'a>
source§fn extend<I: IntoIterator<Item = E>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = E>>(&mut self, iter: I)
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