Struct xmp_toolkit::XmpValue
source · pub struct XmpValue<T: Clone + Debug + Default + PartialEq> {
pub value: T,
/* private fields */
}
Expand description
Describes a single property or item in an array property.
Fields§
§value: T
Core value for this item (typically a String
or scalar value).
Implementations§
source§impl<T: Clone + Debug + Default + PartialEq> XmpValue<T>
impl<T: Clone + Debug + Default + PartialEq> XmpValue<T>
sourcepub fn has_no_flags(&self) -> bool
pub fn has_no_flags(&self) -> bool
Returns true
if none of the other is...
or has...
flags
for this value are true.
sourcepub fn is_uri(&self) -> bool
pub fn is_uri(&self) -> bool
Returns true
if the XML string form of this property value is a URI,
meaning it uses the rdf:resource
attribute.
This is flagged as “discouraged” in the C++ XMP Toolkit API documentation.
sourcepub fn set_is_uri(self, value: bool) -> Self
pub fn set_is_uri(self, value: bool) -> Self
Set this flag if the XML string form of this property value is a URI,
meaning it uses the rdf:resource
attribute.
This is flagged as “discouraged” in the C++ XMP Toolkit API documentation.
sourcepub fn has_qualifiers(&self) -> bool
pub fn has_qualifiers(&self) -> bool
Returns true
if the property has qualifiers, such as rdf:type
xml:lang
.
sourcepub fn set_has_qualifiers(self, value: bool) -> Self
pub fn set_has_qualifiers(self, value: bool) -> Self
Set this flag if the property has qualifiers, such as rdf:type
xml:lang
.
sourcepub fn is_qualifier(&self) -> bool
pub fn is_qualifier(&self) -> bool
Returns true
if this property is a qualifier for some other property,
such as rdf:type
and xml:lang
.
Qualifiers can have arbitrary structure, and can themselves have qualifiers. If the qualifier itself has a structured value, this flag is only set for the top node of the qualifier’s subtree.
sourcepub fn set_is_qualifier(self, value: bool) -> Self
pub fn set_is_qualifier(self, value: bool) -> Self
Set this flag if this property is a qualifier for some other property,
such as rdf:type
and xml:lang
.
Qualifiers can have arbitrary structure, and can themselves have qualifiers. If the qualifier itself has a structured value, this flag is only set for the top node of the qualifier’s subtree.
sourcepub fn has_lang(&self) -> bool
pub fn has_lang(&self) -> bool
Returns true
if this property has an xml:lang
qualifier.
Implies has_qualifiers
will also be true.
sourcepub fn set_has_lang(self, value: bool) -> Self
pub fn set_has_lang(self, value: bool) -> Self
Set this flag if this property has an xml:lang
qualifier.
Implies has_qualifiers
will also be true.
sourcepub fn has_type(&self) -> bool
pub fn has_type(&self) -> bool
Returns true
if this property has an rdf:type
qualifier.
Implies has_qualifiers
will also be true.
sourcepub fn set_has_type(self, value: bool) -> Self
pub fn set_has_type(self, value: bool) -> Self
Set this flag if this property has an rdf:type
qualifier.
Implies has_qualifiers
will also be true.
sourcepub fn set_is_struct(self, value: bool) -> Self
pub fn set_is_struct(self, value: bool) -> Self
Set this flag if this value is a structure with nested fields.
sourcepub fn is_array(&self) -> bool
pub fn is_array(&self) -> bool
Returns true
if this value is an array (RDF alt/bag/seq).
This may mean the array is ordered or unordered. Use the is_ordered
query to discern between the two.
sourcepub fn set_is_array(self, value: bool) -> Self
pub fn set_is_array(self, value: bool) -> Self
Set this flag if this value is an array (RDF alt/bag/seq).
This may mean the array is ordered or unordered. Use the is_ordered
query to discern between the two.
sourcepub fn is_ordered(&self) -> bool
pub fn is_ordered(&self) -> bool
Returns true
if the item order matters. In other words, this
array has been serialized using an rdf:Seq
container.
Implies that is_array
is also true
.
sourcepub fn set_is_ordered(self, value: bool) -> Self
pub fn set_is_ordered(self, value: bool) -> Self
Set this flag if the item order matters. In other words, this
array has been serialized using an rdf:Seq
container.
Implies that is_array
is also true
.
sourcepub fn is_alternate(&self) -> bool
pub fn is_alternate(&self) -> bool
Returns true
if the items in this array are alternates. In other
words, this array has been serialized using an rdf:Alt
container.
Implies that is_array
and is_ordered
are also true
.
sourcepub fn set_is_alternate(self, value: bool) -> Self
pub fn set_is_alternate(self, value: bool) -> Self
Set this flag if the items in this array are alternates. In other
words, this array has been serialized using an rdf:Alt
container.
Implies that is_array
and is_ordered
are also true
.
sourcepub fn is_alt_text(&self) -> bool
pub fn is_alt_text(&self) -> bool
Returns true
if items are localized text. Each array element will be
a simple property with an xml:lang
attribute.
Implies is_alternate
is also true.
sourcepub fn set_is_alt_text(self, value: bool) -> Self
pub fn set_is_alt_text(self, value: bool) -> Self
Set this flag if items are localized text. Each array element will be
a simple property with an xml:lang
attribute.
Implies is_alternate
is also true.
sourcepub fn is_alias(&self) -> bool
pub fn is_alias(&self) -> bool
Returns true
if this property is an alias name for another property.
This is only returned by XmpMeta::property
and then only if the property name is simple, not a path expression.
sourcepub fn set_is_alias(self, value: bool) -> Self
pub fn set_is_alias(self, value: bool) -> Self
Set this flag if this property is an alias name for another property.
sourcepub fn has_aliases(&self) -> bool
pub fn has_aliases(&self) -> bool
Returns true
if this property is the base value (actual) for a set
of aliases.
This is only returned by XmpMeta::property
and then only if the property name is simple, not a path expression.
sourcepub fn set_has_aliases(self, value: bool) -> Self
pub fn set_has_aliases(self, value: bool) -> Self
Set this flag if this property is the base value (actual) for a set of aliases.
sourcepub fn is_internal(&self) -> bool
pub fn is_internal(&self) -> bool
Returns true
if this property is “owned” by the application,
and should not generally be editable in a UI.
sourcepub fn set_is_internal(self, value: bool) -> Self
pub fn set_is_internal(self, value: bool) -> Self
Set this flag if this property is “owned” by the application, and should not generally be editable in a UI.
sourcepub fn is_stable(&self) -> bool
pub fn is_stable(&self) -> bool
Returns true
if the value of this property is not derived from
the document content.
sourcepub fn set_is_stable(self, value: bool) -> Self
pub fn set_is_stable(self, value: bool) -> Self
Set this flag if the value of this property is not derived from the document content.
sourcepub fn is_derived(&self) -> bool
pub fn is_derived(&self) -> bool
Returns true
if the value of this property is derived from the
document content.
sourcepub fn set_is_derived(self, value: bool) -> Self
pub fn set_is_derived(self, value: bool) -> Self
Set this flag if the value of this property is derived from the document content.
sourcepub fn is_schema_node(&self) -> bool
pub fn is_schema_node(&self) -> bool
Returns true
if this property is an schema node, which is
created implicitly during iteration via XmpIterator
.