#[non_exhaustive]pub struct DescriptionListItem<'a> {
pub anchors: Vec<Anchor<'a>>,
pub term: Vec<InlineNode<'a>>,
pub delimiter: &'a str,
pub delimiter_location: Option<Location>,
pub principal_text: Vec<InlineNode<'a>>,
pub description: Vec<Block<'a>>,
pub location: Location,
}Expand description
An item in a description list (term + description).
§Structure
term:: principal text <- term, delimiter, principal_text
description <- description (blocks)§Note on Field Names
descriptionis singular (notdescriptions) - it holds the block content following the termprincipal_textis inline content immediately after the delimiter on the same line
fn has_description(item: &DescriptionListItem) -> bool {
!item.description.is_empty() // Note: singular 'description'
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.anchors: Vec<Anchor<'a>>Optional anchors (IDs) attached to this item.
term: Vec<InlineNode<'a>>The term being defined (inline content before the delimiter).
delimiter: &'a strThe delimiter used (::, :::, ::::, or ;;).
delimiter_location: Option<Location>Location of the delimiter in the source.
principal_text: Vec<InlineNode<'a>>Inline content immediately after the delimiter on the same line.
description: Vec<Block<'a>>Block content providing the description (singular, not plural).
location: LocationTrait Implementations§
Source§impl<'a> Clone for DescriptionListItem<'a>
impl<'a> Clone for DescriptionListItem<'a>
Source§fn clone(&self) -> DescriptionListItem<'a>
fn clone(&self) -> DescriptionListItem<'a>
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<'a> Debug for DescriptionListItem<'a>
impl<'a> Debug for DescriptionListItem<'a>
Source§impl<'a> PartialEq for DescriptionListItem<'a>
impl<'a> PartialEq for DescriptionListItem<'a>
Source§impl<'a> Serialize for DescriptionListItem<'a>
impl<'a> Serialize for DescriptionListItem<'a>
impl<'a> StructuralPartialEq for DescriptionListItem<'a>
Auto Trait Implementations§
impl<'a> Freeze for DescriptionListItem<'a>
impl<'a> RefUnwindSafe for DescriptionListItem<'a>
impl<'a> Send for DescriptionListItem<'a>
impl<'a> Sync for DescriptionListItem<'a>
impl<'a> Unpin for DescriptionListItem<'a>
impl<'a> UnsafeUnpin for DescriptionListItem<'a>
impl<'a> UnwindSafe for DescriptionListItem<'a>
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