pub struct UnorderedList {
layout: LinearLayout,
bullet: Option<String>,
}Expand description
An unordered list of elements with bullet points.
§Examples
With setters:
use genpdfi_extended::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 genpdfi_extended::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 genpdfi_extended::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 genpdfi_extended::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"))
)
);Fields§
§layout: LinearLayout§bullet: Option<String>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, 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.
Source§impl<E: Element + 'static> Extend<E> for UnorderedList
impl<E: Element + 'static> Extend<E> for UnorderedList
Source§fn extend<I: IntoIterator<Item = E>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = E>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<E: Element + 'static> FromIterator<E> for UnorderedList
impl<E: Element + 'static> FromIterator<E> for UnorderedList
Source§fn from_iter<I: IntoIterator<Item = E>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = E>>(iter: I) -> Self
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl Freeze for UnorderedList
impl !RefUnwindSafe for UnorderedList
impl !Send for UnorderedList
impl !Sync for UnorderedList
impl Unpin 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
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.