Skip to main content

StringAttribute

Struct StringAttribute 

Source
pub struct StringAttribute<S: AttributeShape> { /* private fields */ }
Expand description

A typed string attribute handle.

Use Fixed for ordinary string tuples and Jagged for HAPI string array attributes.

Implementations§

Source§

impl<S: AttributeShape> StringAttribute<S>

Source

pub fn info(&self) -> &AttributeInfo

Returns the currently cached metadata.

Source

pub fn name(&self) -> &CStr

Returns the attribute name.

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 storage(&self) -> StorageType

Returns the HAPI storage type.

Source

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

Deletes this attribute from its bound node and part.

Source§

impl StringAttribute<Fixed>

Source

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

Refreshes cached metadata, requiring fixed string storage.

Source§

impl StringAttribute<Jagged>

Source

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

Refreshes cached metadata, requiring jagged string storage.

Source§

impl StringAttribute<Fixed>

Source

pub fn get(&self) -> Result<StringArray>

Reads the complete fixed-tuple attribute.

Source

pub fn get_range(&self, range: Range<usize>) -> Result<StringArray>

Reads a range of owned elements as flattened string tuples.

Source

pub fn set(&self, values: &[impl AsRef<CStr>]) -> Result<()>

Replaces the complete fixed-tuple attribute.

The value count must equal count * tuple_size.

Source

pub fn set_range( &self, range: Range<usize>, values: &[impl AsRef<CStr>], ) -> Result<()>

Replaces a range of owned elements from flattened string tuples.

Source§

impl StringAttribute<Fixed>

Source

pub fn set_unique(&self, value: &CStr) -> Result<()>

Assigns one string value to every element of the attribute.

Source

pub fn set_indexed( &self, values: &[impl AsRef<CStr>], indices: &[i32], ) -> Result<()>

Sets the complete attribute using a table of unique strings and indices.

indices must contain count * tuple_size entries. Each index is interpreted by HAPI as an entry in values.

Source§

impl StringAttribute<Jagged>

Source

pub fn get(&self) -> Result<StringJaggedArrayData>

Reads the complete string or dictionary array attribute.

Source

pub fn set(&self, values: &[impl AsRef<CStr>], sizes: &[i32]) -> Result<()>

Replaces the complete string or dictionary array attribute.

Sizes must be nonnegative, sum to values.len(), and contain one entry for every owned geometry element.

Trait Implementations§

Source§

impl<S: Clone + AttributeShape> Clone for StringAttribute<S>

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<S: Debug + AttributeShape> Debug for StringAttribute<S>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<S> !RefUnwindSafe for StringAttribute<S>

§

impl<S> !UnwindSafe for StringAttribute<S>

§

impl<S> Forget for StringAttribute<S>

§

impl<S> Freeze for StringAttribute<S>
where PhantomData<S>: Freeze,

§

impl<S> Move for StringAttribute<S>

§

impl<S> Send for StringAttribute<S>
where PhantomData<S>: Send,

§

impl<S> Sync for StringAttribute<S>
where PhantomData<S>: Sync,

§

impl<S> Unpin for StringAttribute<S>
where PhantomData<S>: Unpin,

§

impl<S> UnsafeUnpin for StringAttribute<S>

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.