#[non_exhaustive]pub struct BlockMetadata<'a> {
pub attributes: ElementAttributes<'a>,
pub roles: Vec<Role<'a>>,
pub options: Vec<&'a str>,
pub style: Option<&'a str>,
pub id: Option<Anchor<'a>>,
pub anchors: Vec<Anchor<'a>>,
pub substitutions: Option<SubstitutionSpec>,
pub attribution: Option<Attribution<'a>>,
pub citetitle: Option<CiteTitle<'a>>,
pub location: Option<Location>,
/* private fields */
}Expand description
A BlockMetadata represents the metadata of a block in a document.
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.attributes: ElementAttributes<'a>§roles: Vec<Role<'a>>§options: Vec<&'a str>§style: Option<&'a str>§id: Option<Anchor<'a>>§anchors: Vec<Anchor<'a>>§substitutions: Option<SubstitutionSpec>Substitutions to apply to block content.
None: Use block-type defaults (VERBATIM for listing/literal, NORMAL for paragraphs)Some(Explicit([])): No substitutions (equivalent tosubs=none)Some(Explicit(list)): Use the explicit list of substitutionsSome(Modifiers(ops)): Apply modifier operations to block-type defaults
attribution: Option<Attribution<'a>>§citetitle: Option<CiteTitle<'a>>§location: Option<Location>Implementations§
Source§impl<'a> BlockMetadata<'a>
impl<'a> BlockMetadata<'a>
Sourcepub fn with_attributes(self, attributes: ElementAttributes<'a>) -> Self
pub fn with_attributes(self, attributes: ElementAttributes<'a>) -> Self
Set the attributes.
Sourcepub fn with_options(self, options: Vec<&'a str>) -> Self
pub fn with_options(self, options: Vec<&'a str>) -> Self
Set the options.
Sourcepub fn with_roles(self, roles: Vec<Role<'a>>) -> Self
pub fn with_roles(self, roles: Vec<Role<'a>>) -> Self
Set the roles.
Sourcepub fn with_style(self, style: Option<&'a str>) -> Self
pub fn with_style(self, style: Option<&'a str>) -> Self
Set the style.
pub fn is_default(&self) -> bool
Trait Implementations§
Source§impl<'a> Clone for BlockMetadata<'a>
impl<'a> Clone for BlockMetadata<'a>
Source§fn clone(&self) -> BlockMetadata<'a>
fn clone(&self) -> BlockMetadata<'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 BlockMetadata<'a>
impl<'a> Debug for BlockMetadata<'a>
Source§impl<'a> Default for BlockMetadata<'a>
impl<'a> Default for BlockMetadata<'a>
Source§fn default() -> BlockMetadata<'a>
fn default() -> BlockMetadata<'a>
Returns the “default value” for a type. Read more
Source§impl<'a> PartialEq for BlockMetadata<'a>
impl<'a> PartialEq for BlockMetadata<'a>
Source§impl<'a> Serialize for BlockMetadata<'a>
impl<'a> Serialize for BlockMetadata<'a>
impl<'a> StructuralPartialEq for BlockMetadata<'a>
Auto Trait Implementations§
impl<'a> Freeze for BlockMetadata<'a>
impl<'a> RefUnwindSafe for BlockMetadata<'a>
impl<'a> Send for BlockMetadata<'a>
impl<'a> Sync for BlockMetadata<'a>
impl<'a> Unpin for BlockMetadata<'a>
impl<'a> UnsafeUnpin for BlockMetadata<'a>
impl<'a> UnwindSafe for BlockMetadata<'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