Skip to main content

FormatMetadata

Struct FormatMetadata 

Source
pub struct FormatMetadata { /* private fields */ }
Expand description

Structured metadata attached to transforms and baked outputs.

Implementations§

Source§

impl FormatMetadata

Source

pub fn to_native_string(&self) -> Result<String>

Format metadata using OCIO’s native stream operator. This is diagnostic text, not an XML serializer, and is copied into a Rust-owned string.

Source

pub fn element_name(&self) -> Option<String>

Get the element name.

Source

pub fn try_element_name(&self) -> Result<Option<String>>

Get the element name, reporting an invalidated handle.

Source

pub fn set_element_name(&self, name: impl AsRef<str>) -> Result<()>

Set the element name.

Source

pub fn element_value(&self) -> Option<String>

Get the element value.

Source

pub fn try_element_value(&self) -> Result<Option<String>>

Get the element value, reporting an invalidated handle.

Source

pub fn set_element_value(&self, value: impl AsRef<str>) -> Result<()>

Set the element value.

Source

pub fn num_attributes(&self) -> i32

Get the number of attributes on this metadata element.

Source

pub fn try_num_attributes(&self) -> Result<i32>

Get the attribute count, reporting an invalidated handle.

Source

pub fn attribute_name(&self, i: i32) -> Option<String>

Get the attribute name at the given index.

Source

pub fn try_attribute_name(&self, i: i32) -> Result<Option<String>>

Get an attribute name, reporting an invalidated handle.

Source

pub fn attribute_value_by_index(&self, i: i32) -> Option<String>

Get the attribute value at the given index.

Source

pub fn try_attribute_value_by_index(&self, i: i32) -> Result<Option<String>>

Get an attribute value by index, preserving OCIO query failures.

Source

pub fn attribute_value(&self, name: impl AsRef<str>) -> Option<String>

Get the attribute value by name.

Source

pub fn try_attribute_value( &self, name: impl AsRef<str>, ) -> Result<Option<String>>

Get an attribute value by name, preserving invalid input and OCIO failures.

Source

pub fn add_attribute( &self, name: impl AsRef<str>, value: impl AsRef<str>, ) -> Result<()>

Add a name-value attribute to this metadata element.

Source

pub fn num_children(&self) -> i32

Get the number of child elements.

Source

pub fn try_num_children(&self) -> Result<i32>

Get the child count, reporting an invalidated handle.

Source

pub fn child_element(&self, i: i32) -> Option<FormatMetadata>

Get a live child element at the given index.

The wrapper remains usable when siblings are appended. Clearing an ancestor invalidates it: subsequent fallible operations return an error even if a new child later occupies the same index.

Source

pub fn try_child_element(&self, i: i32) -> Result<Option<FormatMetadata>>

Get a live child element by index, preserving OCIO query failures.

See Self::child_element for invalidation behavior.

Source

pub fn add_child_element( &self, name: impl AsRef<str>, value: impl AsRef<str>, ) -> Result<()>

Add a child element with the given name and value.

Source

pub fn clear(&self)

Clear all data on this metadata element.

Source

pub fn try_clear(&self) -> Result<()>

Clear this element and invalidate all previously obtained descendants.

Source

pub fn assign(&self, source: &FormatMetadata) -> Result<()>

Replace this element with a deep copy of source, matching native metadata assignment. Existing descendants of this element are invalidated, including if native assignment fails after it begins. Assigning an element to itself is a no-op. Overlapping source and destination trees are supported by snapshotting the source first.

Source

pub fn assign_const(&self, source: &ConstFormatMetadata) -> Result<()>

Replace this element with a copy of processor-owned read-only metadata.

This copies directly from the native processor metadata without first creating an editable intermediate. Existing descendants are invalidated before assignment, including if native assignment subsequently fails.

Source

pub fn name(&self) -> Option<String>

Get the name of this metadata element.

Source

pub fn try_name(&self) -> Result<Option<String>>

Get the name attribute, reporting an invalidated handle.

Source

pub fn set_name(&self, name: impl AsRef<str>) -> Result<()>

Set the name of this metadata element.

Source

pub fn id(&self) -> Option<String>

Get the ID of this metadata element.

Source

pub fn try_id(&self) -> Result<Option<String>>

Get the ID attribute, reporting an invalidated handle.

Source

pub fn set_id(&self, id: impl AsRef<str>) -> Result<()>

Set the ID of this metadata element.

Trait Implementations§

Source§

impl Drop for FormatMetadata

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.