#[non_exhaustive]pub struct BlockMetadata {
pub attributes: ElementAttributes,
pub positional_attributes: Vec<String>,
pub roles: Vec<Role>,
pub options: Vec<String>,
pub style: Option<String>,
pub id: Option<Anchor>,
pub anchors: Vec<Anchor>,
}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§positional_attributes: Vec<String>§roles: Vec<Role>§options: Vec<String>§style: Option<String>§id: Option<Anchor>§anchors: Vec<Anchor>Implementations§
Source§impl BlockMetadata
impl BlockMetadata
Sourcepub fn with_attributes(self, attributes: ElementAttributes) -> Self
pub fn with_attributes(self, attributes: ElementAttributes) -> Self
Set the attributes.
Sourcepub fn with_options(self, options: Vec<String>) -> Self
pub fn with_options(self, options: Vec<String>) -> Self
Set the options.
Sourcepub fn with_roles(self, roles: Vec<Role>) -> Self
pub fn with_roles(self, roles: Vec<Role>) -> Self
Set the roles.
Sourcepub fn with_style(self, style: Option<String>) -> Self
pub fn with_style(self, style: Option<String>) -> Self
Set the style.
pub fn move_positional_attributes_to_attributes(&mut self)
pub fn set_attributes(&mut self, attributes: ElementAttributes)
pub fn is_default(&self) -> bool
pub fn merge(&mut self, other: &BlockMetadata)
Trait Implementations§
Source§impl Clone for BlockMetadata
impl Clone for BlockMetadata
Source§fn clone(&self) -> BlockMetadata
fn clone(&self) -> BlockMetadata
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 BlockMetadata
impl Debug for BlockMetadata
Source§impl Default for BlockMetadata
impl Default for BlockMetadata
Source§fn default() -> BlockMetadata
fn default() -> BlockMetadata
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BlockMetadata
impl<'de> Deserialize<'de> for BlockMetadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for BlockMetadata
impl PartialEq for BlockMetadata
Source§impl Serialize for BlockMetadata
impl Serialize for BlockMetadata
impl StructuralPartialEq for BlockMetadata
Auto Trait Implementations§
impl Freeze for BlockMetadata
impl RefUnwindSafe for BlockMetadata
impl Send for BlockMetadata
impl Sync for BlockMetadata
impl Unpin for BlockMetadata
impl UnwindSafe for BlockMetadata
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