Struct genpdf::elements::TableLayoutRow[][src]

pub struct TableLayoutRow<'a> { /* fields omitted */ }
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 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 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.

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

Performs the conversion.

Performs the conversion.

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.