pub struct UnorderedList { /* private fields */ }Expand description
An unordered list of elements with bullet points.
§Examples
With setters:
use 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 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 genpdf::elements;
let list = elements::UnorderedList::new()
.element(elements::Paragraph::new("first"))
.element(elements::Paragraph::new("second"))
.element(elements::Paragraph::new("third"));Implementations§
Source§impl UnorderedList
impl UnorderedList
Sourcepub fn new() -> UnorderedList
pub fn new() -> UnorderedList
Creates a new unordered list with the default bullet point symbol.
Sourcepub fn with_bullet(bullet: impl Into<String>) -> UnorderedList
pub fn with_bullet(bullet: impl Into<String>) -> UnorderedList
Creates a new unordered list with the given bullet point symbol.
Trait Implementations§
Source§impl Default for UnorderedList
impl Default for UnorderedList
Source§fn default() -> UnorderedList
fn default() -> UnorderedList
Returns the “default value” for a type. Read more
Source§impl Element for UnorderedList
impl Element for UnorderedList
Source§fn render(
&mut self,
context: &Context,
area: Area<'_>,
style: Style,
) -> Result<RenderResult, Error>
fn render( &mut self, context: &Context, area: Area<'_>, style: Style, ) -> Result<RenderResult, Error>
Renders this element to the given area using the given style and font cache. Read more
Source§fn framed(self) -> FramedElement<Self>where
Self: Sized,
fn framed(self) -> FramedElement<Self>where
Self: Sized,
Draws a frame around this element.
Auto Trait Implementations§
impl Freeze for UnorderedList
impl !RefUnwindSafe for UnorderedList
impl !Send for UnorderedList
impl !Sync for UnorderedList
impl Unpin for UnorderedList
impl UnsafeUnpin for UnorderedList
impl !UnwindSafe for UnorderedList
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