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>

source

pub fn new(value: T) -> Self

Creates a new value with default flags.

source

pub fn has_no_flags(&self) -> bool

Returns true if none of the other is... or has... flags for this value are true.

source

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.

source

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.

source

pub fn has_qualifiers(&self) -> bool

Returns true if the property has qualifiers, such as rdf:type xml:lang.

source

pub fn set_has_qualifiers(self, value: bool) -> Self

Set this flag if the property has qualifiers, such as rdf:type xml:lang.

source

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.

source

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.

source

pub fn has_lang(&self) -> bool

Returns true if this property has an xml:lang qualifier.

Implies has_qualifiers will also be true.

source

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.

source

pub fn has_type(&self) -> bool

Returns true if this property has an rdf:type qualifier.

Implies has_qualifiers will also be true.

source

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.

source

pub fn is_struct(&self) -> bool

Returns true if this value is a structure with nested fields.

source

pub fn set_is_struct(self, value: bool) -> Self

Set this flag if this value is a structure with nested fields.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

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.

source

pub fn set_is_alias(self, value: bool) -> Self

Set this flag if this property is an alias name for another property.

source

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.

source

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.

source

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.

source

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.

source

pub fn is_stable(&self) -> bool

Returns true if the value of this property is not derived from the document content.

source

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.

source

pub fn is_derived(&self) -> bool

Returns true if the value of this property is derived from the document content.

source

pub fn set_is_derived(self, value: bool) -> Self

Set this flag if the value of this property is derived from the document content.

source

pub fn is_schema_node(&self) -> bool

Returns true if this property is an schema node, which is created implicitly during iteration via XmpIterator.

Trait Implementations§

source§

impl<T: Clone + Clone + Debug + Default + PartialEq> Clone for XmpValue<T>

source§

fn clone(&self) -> XmpValue<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug + Clone + Debug + Default + PartialEq> Debug for XmpValue<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Default + Clone + Debug + Default + PartialEq> Default for XmpValue<T>

source§

fn default() -> XmpValue<T>

Returns the “default value” for a type. Read more
source§

impl From<&str> for XmpValue<String>

source§

fn from(value: &str) -> Self

Converts to this type from the input type.
source§

impl<T: Clone + Debug + Default + PartialEq> From<T> for XmpValue<T>

source§

fn from(value: T) -> Self

Converts to this type from the input type.
source§

impl<T: PartialEq + Clone + Debug + Default + PartialEq> PartialEq for XmpValue<T>

source§

fn eq(&self, other: &XmpValue<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: Eq + Clone + Debug + Default + PartialEq> Eq for XmpValue<T>

source§

impl<T: Clone + Debug + Default + PartialEq> StructuralPartialEq for XmpValue<T>

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for XmpValue<T>
where T: RefUnwindSafe,

§

impl<T> Send for XmpValue<T>
where T: Send,

§

impl<T> Sync for XmpValue<T>
where T: Sync,

§

impl<T> Unpin for XmpValue<T>
where T: Unpin,

§

impl<T> UnwindSafe for XmpValue<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.