pub struct BulletPoint<E: Element> {
element: E,
indent: Mm,
bullet_space: Mm,
bullet: String,
bullet_rendered: bool,
}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 genpdfi_extended::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)"));Fields§
§element: E§indent: Mm§bullet_space: Mm§bullet: String§bullet_rendered: boolImplementations§
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.
Auto Trait Implementations§
impl<E> Freeze for BulletPoint<E>where
E: Freeze,
impl<E> RefUnwindSafe for BulletPoint<E>where
E: RefUnwindSafe,
impl<E> Send for BulletPoint<E>where
E: Send,
impl<E> Sync for BulletPoint<E>where
E: Sync,
impl<E> Unpin for BulletPoint<E>where
E: Unpin,
impl<E> UnwindSafe for BulletPoint<E>where
E: UnwindSafe,
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
Source§impl<E> IntoBoxedElement for Ewhere
E: Element + 'static,
impl<E> IntoBoxedElement for Ewhere
E: Element + 'static,
Source§fn into_boxed_element(self) -> Box<dyn Element>
fn into_boxed_element(self) -> Box<dyn Element>
Creates a boxed element from this element.
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.