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.