pub struct XmpMeta { /* private fields */ }
Expand description

The XmpMeta struct allows access to the XMP Toolkit core services.

You can create XmpMeta structs from metadata that you construct, or that you obtain from files using the XmpFile struct.

Implementations

Creates a new, empty metadata struct.

An error result from this function is unlikely but possible if, for example, the C++ XMP Toolkit fails to initialize or reports an out-of-memory condition.

Reads the XMP from a file without keeping the file open.

This is a convenience function for read-only workflows.

Arguments
  • path: Path to the file to be read

Registers a namespace URI with a suggested prefix.

If the URI is not registered but the suggested prefix is in use, a unique prefix is created from the suggested one. The actual registered prefix is returned. It is not an error if the URI is already registered, regardless of the prefix.

Arguments
  • namespace_uri: The URI for the namespace. Must be a valid XML URI.

  • suggested_prefix: The suggested prefix to be used if the URI is not yet registered. Must be a valid XML name.

Returns the prefix actually registered for this URI.

Gets a property value.

When specifying a namespace and path (in this and all other accessors):

  • If a namespace URI is specified, it must be for a registered namespace.
  • If the namespace is specified only by a prefix in the property name path, it must be a registered prefix.
  • If both a URI and path prefix are present, they must be corresponding parts of a registered namespace.
Arguments
  • schema_ns: The namespace URI for the property. The URI must be for a registered namespace. Must not be an empty string.

  • prop_name: The name of the property. Can be a general path expression. Must not be an empty string. The first component can be a namespace prefix; if present without a schema_ns value, the prefix specifies the namespace. The prefix must be for a registered namespace, and if a namespace URI is specified, must match the registered prefix for that namespace.

Error handling

Any errors (for instance, empty or invalid namespace or property name) are ignored; the function will return None in such cases.

Creates or sets a property value.

This is the simplest property setter. Use it for top-level simple properties.

Arguments
  • schema_ns: The namespace URI; see XmpMeta::property().

  • prop_name: The name of the property. Can be a general path expression. Must not be an empty string. See XmpMeta::property() for namespace prefix usage.

  • prop_value: The new value.

Creates or sets a property value using an XmpDateTime structure.

This is the simplest property setter. Use it for top-level simple properties.

Arguments
  • schema_ns: The namespace URI; see XmpMeta::property().

  • prop_name: The name of the property. Can be a general path expression. Must not be an empty string. See XmpMeta::property() for namespace prefix usage.

  • prop_value: The new value.

Reports whether a property currently exists.

Arguments
  • schema_ns: The namespace URI; see XmpMeta::property().

  • prop_name: The name of the property. Can be a general path expression. Must not be an empty string. See XmpMeta::property() for namespace prefix usage.

Error handling

Any errors (for instance, empty or invalid namespace or property name) are ignored; the function will return false in such cases.

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.