pub struct DocumentAttributeValue<'a>(/* private fields */);Expand description
A defined document attribute, including its retained text representation.
Numeric values use attribute-specific validation. Text is not inferred to be numeric merely because it contains digits.
Implementations§
Source§impl<'a> DocumentAttributeValue<'a>
impl<'a> DocumentAttributeValue<'a>
Sourcepub const fn as_integer(&self) -> Option<i128>
pub const fn as_integer(&self) -> Option<i128>
Return the validated integer, without parsing a textual value.
Sourcepub const fn is_presence(&self) -> bool
pub const fn is_presence(&self) -> bool
Return whether the attribute was set without a semantic value.
Sourcepub fn text(&self) -> Option<&str>
pub fn text(&self) -> Option<&str>
Return retained text, including the spelling of an explicit integer.
Presence and generated integer defaults have no supplied text. This does not remove surrounding quotes or undo definition-time substitution.
Sourcepub fn write_text<W: Write>(&self, output: &mut W) -> Result
pub fn write_text<W: Write>(&self, output: &mut W) -> Result
Write the attribute-reference representation without allocating.
Presence writes nothing; explicit integers retain their spelling.
§Errors
Returns errors from the output buffer.
Sourcepub fn into_static(self) -> DocumentAttributeValue<'static>
pub fn into_static(self) -> DocumentAttributeValue<'static>
Consume the value, retaining existing allocations for owned text.