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§

Adds the given element to this row.

Adds the given element to this row and returns the row.

Tries to append this row to the table.

This method fails if the number of elements in this row does not match the number of columns in the table.

Trait Implementations§

Extends a collection with the contents of an iterator. Read more
🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
🔬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§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.