pub struct DocumentAttributes<'a> { /* private fields */ }Expand description
Validated document attributes with universal defaults.
Parsed documents expose their end-of-header snapshot through this read-only
view. Use crate::Options::builder() to supply values.
Use DocumentAttributes::default() to get a map with universal defaults applied.
Parsed attributes cannot be changed through the read API:
let mut attributes = acdc_parser::DocumentAttributes::default();
attributes.set("name".into(), "value".into());Implementations§
Source§impl<'a> DocumentAttributes<'a>
impl<'a> DocumentAttributes<'a>
Sourcepub fn into_inputs(
self,
) -> impl Iterator<Item = (AttributeName<'a>, AttributeValue<'a>)>
pub fn into_inputs( self, ) -> impl Iterator<Item = (AttributeName<'a>, AttributeValue<'a>)>
Reuse explicit values as fresh configuration, retaining unsets and spelling.
Universal defaults remain implicit. Rebuilding options determines the new assignment precedence; parser-internal locks and origins are not exported.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&str, &DocumentAttributeValue<'_>)>
pub fn iter(&self) -> impl Iterator<Item = (&str, &DocumentAttributeValue<'_>)>
Iterate over effective, referenceable attributes.
Sourcepub fn is_explicit(&self, name: &str) -> bool
pub fn is_explicit(&self, name: &str) -> bool
Whether an explicit assignment exists, including an unset assignment.
Sourcepub fn get(&self, name: &str) -> Option<&DocumentAttributeValue<'_>>
pub fn get(&self, name: &str) -> Option<&DocumentAttributeValue<'_>>
Borrow the effective value, including referenceable defaults.
Sourcepub fn assignment(&self, name: &str) -> Option<&DocumentAttributeAssignment<'_>>
pub fn assignment(&self, name: &str) -> Option<&DocumentAttributeAssignment<'_>>
Borrow an explicit assignment, distinguishing unset from absent.
Sourcepub fn assignments(
&self,
) -> impl Iterator<Item = (&str, &DocumentAttributeAssignment<'_>)>
pub fn assignments( &self, ) -> impl Iterator<Item = (&str, &DocumentAttributeAssignment<'_>)>
Iterate over explicit assignments, including unsets but not implicit defaults.
Sourcepub fn contains_key(&self, name: &str) -> bool
pub fn contains_key(&self, name: &str) -> bool
Return whether the attribute has an effective value.
Sourcepub fn to_static(&self) -> DocumentAttributes<'static>
pub fn to_static(&self) -> DocumentAttributes<'static>
Clone the attributes into an independent 'static copy. Used by
converters that cache document attributes on a processor whose
lifetime is independent of the document being rendered.
Sourcepub fn into_static(self) -> DocumentAttributes<'static>
pub fn into_static(self) -> DocumentAttributes<'static>
Consume the attributes, producing an independent 'static copy.