Struct rckive_genpdf::elements::BulletPoint
source · pub struct BulletPoint<E: Element> { /* private fields */ }
Expand description
A bullet point in a list.
This is a helper element for the OrderedList
and UnorderedList
types, but you can
also use it directly if you have special requirements.
Example
use rckive_genpdf::elements;
let layout = elements::LinearLayout::vertical()
.element(elements::BulletPoint::new(elements::Paragraph::new("first"))
.with_bullet("a)"))
.element(elements::BulletPoint::new(elements::Paragraph::new("second"))
.with_bullet("b)"));
Implementations§
source§impl<E: Element> BulletPoint<E>
impl<E: Element> BulletPoint<E>
sourcepub fn new(element: E) -> BulletPoint<E>
pub fn new(element: E) -> BulletPoint<E>
Creates a new bullet point with the given element.
sourcepub fn set_bullet(&mut self, bullet: impl Into<String>)
pub fn set_bullet(&mut self, bullet: impl Into<String>)
Sets the bullet point symbol for this bullet point.
sourcepub fn with_bullet(self, bullet: impl Into<String>) -> Self
pub fn with_bullet(self, bullet: impl Into<String>) -> Self
Sets the bullet point symbol for this bullet point and returns the bullet point.
Trait Implementations§
source§impl<E: Element> Element for BulletPoint<E>
impl<E: Element> Element for BulletPoint<E>
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, line_style: impl Into<LineStyle>) -> FramedElement<Self>where
Self: Sized,
fn framed(self, line_style: impl Into<LineStyle>) -> FramedElement<Self>where
Self: Sized,
Draws a frame around this element using the given line style.