pub struct Attribute<'a> { /* private fields */ }Expand description
One attribute of a name: what kind of thing it is, and the value.
Implementations§
Source§impl<'a> Attribute<'a>
impl<'a> Attribute<'a>
Sourcepub fn value(self) -> AttributeValue<'a>
pub fn value(self) -> AttributeValue<'a>
The value, as encoded.
Sourcepub fn text(self, execution: &Memory) -> Result<Option<OwnedString>>
pub fn text(self, execution: &Memory) -> Result<Option<OwnedString>>
The value as text for a person to read, where it is text at all.
For display. Never for deciding that two names are the same one: see
Name::matches.
§Errors
Returns a located resource error if the execution or storage budget is spent.
Sourcepub fn folds(self, execution: &Memory) -> Result<bool>
pub fn folds(self, execution: &Memory) -> Result<bool>
Whether this value takes part in the preparation the profile describes, or is compared only as the bytes it was written in.
A caller explaining why a name did not match needs the same answer this comparison uses, not a guess at it: a value can be excluded for its encoding, for a code point the type prohibits, or for failing the direction step, and only one of those is visible from the outside.
§Errors
Returns a located resource error if preparation cannot be financed.
Sourcepub fn folds_in(self, parent: &Reader<'_, '_>) -> Result<bool>
pub fn folds_in(self, parent: &Reader<'_, '_>) -> Result<bool>
Whether this value prepares under the current producing query’s limits.
Uses the same preparation as Self::folds, funding scans and scratch
through parent.execution() instead of only its aggregate account.
Deferred BER strings retain this attribute’s original offset and depth
and use the supplied reader’s session, just as Name::ordered_in.
A query over another source supplies its original-source reader rebound
to the current operation; retained Name storage is neither copied nor
charged again. Resource refusal is an error, never a byte-only answer.