pub struct ListBuilder { /* private fields */ }
Implementations§
Source§impl ListBuilder
impl ListBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Examples found in repository?
examples/basic.rs (line 9)
5fn main() {
6 let mut md = Markdown::new();
7 for _ in 1..=10 {
8 md.header1("hello").list(
9 ListBuilder::new()
10 .add("first")
11 .add("second")
12 .add(CheckmarkItem {
13 text: "Buy groceries",
14 checked: true,
15 })
16 .ordered(),
17 );
18 let link = Link::builder()
19 .footer(true)
20 .text("Hello")
21 .inlined()
22 .url("https://hello.world")
23 .build();
24 md.link(link);
25 }
26 println!("{}", md);
27}
Sourcepub fn add(self, item: impl Into<ListItem>) -> Self
👎Deprecated since 0.3.0: Please use the append
function instead.
pub fn add(self, item: impl Into<ListItem>) -> Self
append
function instead.Examples found in repository?
examples/basic.rs (line 10)
5fn main() {
6 let mut md = Markdown::new();
7 for _ in 1..=10 {
8 md.header1("hello").list(
9 ListBuilder::new()
10 .add("first")
11 .add("second")
12 .add(CheckmarkItem {
13 text: "Buy groceries",
14 checked: true,
15 })
16 .ordered(),
17 );
18 let link = Link::builder()
19 .footer(true)
20 .text("Hello")
21 .inlined()
22 .url("https://hello.world")
23 .build();
24 md.link(link);
25 }
26 println!("{}", md);
27}
pub fn append(self, item: impl Into<ListItem>) -> Self
Sourcepub fn ordered(self) -> List
pub fn ordered(self) -> List
Examples found in repository?
examples/basic.rs (line 16)
5fn main() {
6 let mut md = Markdown::new();
7 for _ in 1..=10 {
8 md.header1("hello").list(
9 ListBuilder::new()
10 .add("first")
11 .add("second")
12 .add(CheckmarkItem {
13 text: "Buy groceries",
14 checked: true,
15 })
16 .ordered(),
17 );
18 let link = Link::builder()
19 .footer(true)
20 .text("Hello")
21 .inlined()
22 .url("https://hello.world")
23 .build();
24 md.link(link);
25 }
26 println!("{}", md);
27}
pub fn unordered(self) -> List
Trait Implementations§
Source§impl Clone for ListBuilder
impl Clone for ListBuilder
Source§fn clone(&self) -> ListBuilder
fn clone(&self) -> ListBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ListBuilder
impl Debug for ListBuilder
Source§impl Default for ListBuilder
impl Default for ListBuilder
Source§fn default() -> ListBuilder
fn default() -> ListBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ListBuilder
impl !RefUnwindSafe for ListBuilder
impl !Send for ListBuilder
impl !Sync for ListBuilder
impl Unpin for ListBuilder
impl !UnwindSafe for ListBuilder
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