Skip to main content

AnyAttribute

Enum AnyAttribute 

Source
pub enum AnyAttribute {
Show 18 variants Int(Attribute<i32, Fixed>), Int64(Attribute<i64, Fixed>), Float(Attribute<f32, Fixed>), Float64(Attribute<f64, Fixed>), String(StringAttribute<Fixed>), Uint8(Attribute<u8, Fixed>), Int8(Attribute<i8, Fixed>), Int16(Attribute<i16, Fixed>), IntArray(Attribute<i32, Jagged>), Int64Array(Attribute<i64, Jagged>), FloatArray(Attribute<f32, Jagged>), Float64Array(Attribute<f64, Jagged>), StringArray(StringAttribute<Jagged>), Uint8Array(Attribute<u8, Jagged>), Int8Array(Attribute<i8, Jagged>), Int16Array(Attribute<i16, Jagged>), Dictionary(DictionaryAttribute<Fixed>), DictionaryArray(DictionaryAttribute<Jagged>),
}
Expand description

Exhaustive runtime representation of every supported HAPI attribute storage.

Returned by crate::geometry::Geometry::get_attribute when the caller does not know the storage in advance. Match a variant to obtain its typed handle, or use the common identity and deletion methods directly.

Variants§

§

Int(Attribute<i32, Fixed>)

A fixed i32 attribute.

§

Int64(Attribute<i64, Fixed>)

A fixed i64 attribute.

§

Float(Attribute<f32, Fixed>)

A fixed f32 attribute.

§

Float64(Attribute<f64, Fixed>)

A fixed f64 attribute.

§

String(StringAttribute<Fixed>)

A fixed string attribute.

§

Uint8(Attribute<u8, Fixed>)

A fixed u8 attribute.

§

Int8(Attribute<i8, Fixed>)

A fixed i8 attribute.

§

Int16(Attribute<i16, Fixed>)

A fixed i16 attribute.

§

IntArray(Attribute<i32, Jagged>)

A jagged i32 array attribute.

§

Int64Array(Attribute<i64, Jagged>)

A jagged i64 array attribute.

§

FloatArray(Attribute<f32, Jagged>)

A jagged f32 array attribute.

§

Float64Array(Attribute<f64, Jagged>)

A jagged f64 array attribute.

§

StringArray(StringAttribute<Jagged>)

A jagged string array attribute.

§

Uint8Array(Attribute<u8, Jagged>)

A jagged u8 array attribute.

§

Int8Array(Attribute<i8, Jagged>)

A jagged i8 array attribute.

§

Int16Array(Attribute<i16, Jagged>)

A jagged i16 array attribute.

§

Dictionary(DictionaryAttribute<Fixed>)

A fixed JSON dictionary attribute.

§

DictionaryArray(DictionaryAttribute<Jagged>)

A jagged JSON dictionary array attribute.

Implementations§

Source§

impl AnyAttribute

Source

pub fn name(&self) -> Cow<'_, str>

Returns the attribute name, replacing invalid UTF-8 if necessary.

Source

pub fn info(&self) -> &AttributeInfo

Returns the currently cached metadata.

Source

pub fn storage(&self) -> StorageType

Returns the HAPI storage represented by the enum variant.

Source

pub fn part_id(&self) -> i32

Returns the HAPI part to which this handle is bound.

Source

pub fn owner(&self) -> AttributeOwner

Returns the element owner of this attribute.

Source

pub fn refresh(&mut self) -> Result<()>

Refreshes the variant’s cached metadata from HAPI.

The enum variant and cache remain unchanged if the attribute is missing or its storage no longer matches the typed handle.

Source

pub fn delete(self) -> Result<()>

Deletes this attribute from its bound node and part.

Trait Implementations§

Source§

impl Clone for AnyAttribute

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for AnyAttribute

Source§

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

Formats the value using the given formatter. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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>,

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.