pub struct DocumentAttributes(/* private fields */);Expand description
Document-level attributes with universal defaults.
These attributes apply to the entire document and include defaults for admonition captions, TOC settings, structural settings, etc.
Use DocumentAttributes::default() to get a map with universal defaults applied.
Implementations§
Source§impl DocumentAttributes
impl DocumentAttributes
Sourcepub fn iter(&self) -> impl Iterator<Item = (&AttributeName, &AttributeValue)>
pub fn iter(&self) -> impl Iterator<Item = (&AttributeName, &AttributeValue)>
Iterate over all attributes.
Sourcepub fn insert(&mut self, name: AttributeName, value: AttributeValue)
pub fn insert(&mut self, name: AttributeName, value: AttributeValue)
Insert a new attribute.
NOTE: This will NOT overwrite an existing attribute with the same name.
Sourcepub fn set(&mut self, name: AttributeName, value: AttributeValue)
pub fn set(&mut self, name: AttributeName, value: AttributeValue)
Set an attribute, overwriting any existing value.
Sourcepub fn get(&self, name: &str) -> Option<&AttributeValue>
pub fn get(&self, name: &str) -> Option<&AttributeValue>
Get an attribute value by name.
Sourcepub fn contains_key(&self, name: &str) -> bool
pub fn contains_key(&self, name: &str) -> bool
Check if an attribute exists.
Sourcepub fn remove(&mut self, name: &str) -> Option<AttributeValue>
pub fn remove(&mut self, name: &str) -> Option<AttributeValue>
Remove an attribute by name.
Sourcepub fn get_string(&self, name: &str) -> Option<String>
pub fn get_string(&self, name: &str) -> Option<String>
Helper to get a string value.
Strips surrounding quotes from the value if present (parser quirk workaround).
Trait Implementations§
Source§impl Clone for DocumentAttributes
impl Clone for DocumentAttributes
Source§fn clone(&self) -> DocumentAttributes
fn clone(&self) -> DocumentAttributes
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 DocumentAttributes
impl Debug for DocumentAttributes
Source§impl Default for DocumentAttributes
impl Default for DocumentAttributes
Source§fn default() -> DocumentAttributes
fn default() -> DocumentAttributes
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DocumentAttributes
impl<'de> Deserialize<'de> for DocumentAttributes
Source§fn deserialize<D>(deserializer: D) -> Result<DocumentAttributes, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<DocumentAttributes, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DocumentAttributes
impl PartialEq for DocumentAttributes
Source§impl Serialize for DocumentAttributes
impl Serialize for DocumentAttributes
impl StructuralPartialEq for DocumentAttributes
Auto Trait Implementations§
impl Freeze for DocumentAttributes
impl RefUnwindSafe for DocumentAttributes
impl Send for DocumentAttributes
impl Sync for DocumentAttributes
impl Unpin for DocumentAttributes
impl UnwindSafe for DocumentAttributes
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