pub struct UnorderedList { /* private fields */ }
Expand description

An unordered list of elements with bullet points.

Examples

With setters:

use rckive_genpdf::elements;
let mut list = elements::UnorderedList::new();
list.push(elements::Paragraph::new("first"));
list.push(elements::Paragraph::new("second"));
list.push(elements::Paragraph::new("third"));

With setters and a custom bullet symbol:

use rckive_genpdf::elements;
let mut list = elements::UnorderedList::with_bullet("*");
list.push(elements::Paragraph::new("first"));
list.push(elements::Paragraph::new("second"));
list.push(elements::Paragraph::new("third"));

Chained:

use rckive_genpdf::elements;
let list = elements::UnorderedList::new()
    .element(elements::Paragraph::new("first"))
    .element(elements::Paragraph::new("second"))
    .element(elements::Paragraph::new("third"));

Nested list using a LinearLayout:

use rckive_genpdf::elements;
let list = elements::UnorderedList::new()
    .element(
        elements::OrderedList::new()
            .element(elements::Paragraph::new("Sublist with bullet point"))
    )
    .element(
        elements::LinearLayout::vertical()
            .element(elements::Paragraph::new("Sublist without bullet point:"))
            .element(
                elements::OrderedList::new()
                    .element(elements::Paragraph::new("first"))
                    .element(elements::Paragraph::new("second"))
            )
    );

Implementations§

Creates a new unordered list with the default bullet point symbol.

Creates a new unordered list with the given bullet point symbol.

Adds an element to this list.

Adds an element to this list and returns the list.

Trait Implementations§

Returns the “default value” for a type. Read more
Renders this element to the given area using the given style and font cache. Read more
Draws a frame around this element using the given line style.
Adds a padding to this element.
Sets the default style for this element and its children.
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
Creates a value from an iterator. 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.

Creates a boxed element from this element.
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.