pub struct ListItem<'src> { /* private fields */ }Expand description
A list item is a special kind of block that contains one or more blocks
attached to it. In the simplest case, this will be a single SimpleBlock
with the principal text for the list item. In other cases, it may be any
number of blocks of any type which, together, form an entry in a list which
is the immediate parent of this block.
Implementations§
Source§impl<'src> ListItem<'src>
impl<'src> ListItem<'src>
Sourcepub fn child_blocks(&'src self) -> ChildBlocks<'src> ⓘ
pub fn child_blocks(&'src self) -> ChildBlocks<'src> ⓘ
Returns a document-order iterator over this list item’s direct child blocks.
For the full subtree, or to search from a Block or Document, use
FindBlocks.
Sourcepub fn list_item_marker(&self) -> ListItemMarker<'src>
pub fn list_item_marker(&self) -> ListItemMarker<'src>
Returns the list item marker that was used for this item.
Sourcepub fn checkbox(&self) -> Option<bool>
pub fn checkbox(&self) -> Option<bool>
Returns the checklist (i.e. task list) state of this item.
An unordered list item whose principal text begins with a checkbox
marker ([ ] , [x] , or [*] ) is a checklist item. The returned
value is Some(true) for a checked item ([x]/[*]), Some(false)
for an unchecked item ([ ]), or None if the item is not a checklist
item.
Trait Implementations§
impl<'src> Eq for ListItem<'src>
Source§impl<'src> IsBlock<'src> for ListItem<'src>
impl<'src> IsBlock<'src> for ListItem<'src>
Source§fn content_model(&self) -> ContentModel
fn content_model(&self) -> ContentModel
ContentModel for this block.Source§fn content_mut(&mut self) -> Option<&mut Content<'src>>
fn content_mut(&mut self) -> Option<&mut Content<'src>>
Source§fn child_blocks_mut(&mut self) -> &mut [Block<'src>]
fn child_blocks_mut(&mut self) -> &mut [Block<'src>]
Source§fn raw_context(&self) -> CowStr<'src>
fn raw_context(&self) -> CowStr<'src>
Source§fn title_source(&'src self) -> Option<Span<'src>>
fn title_source(&'src self) -> Option<Span<'src>>
Source§fn anchor_reftext(&'src self) -> Option<Span<'src>>
fn anchor_reftext(&'src self) -> Option<Span<'src>>
Source§fn attrlist(&'src self) -> Option<&'src Attrlist<'src>>
fn attrlist(&'src self) -> Option<&'src Attrlist<'src>>
Source§fn rendered_content(&'src self) -> Option<&'src str>
fn rendered_content(&'src self) -> Option<&'src str>
Source§fn resolved_context(&'src self) -> CowStr<'src>
fn resolved_context(&'src self) -> CowStr<'src>
Source§fn declared_style(&'src self) -> Option<&'src str>
fn declared_style(&'src self) -> Option<&'src str>
Source§fn options(&'src self) -> Vec<&'src str>
fn options(&'src self) -> Vec<&'src str>
Source§fn has_option<N: AsRef<str>>(&'src self, name: N) -> bool
fn has_option<N: AsRef<str>>(&'src self, name: N) -> bool
true if this block has the named option. Read more