[][src]Struct gut::mesh::attrib::IntrinsicAttribute

pub struct IntrinsicAttribute<T, I> { /* fields omitted */ }

An intrinsic attribute type. This differs from Attribute<I> in that it is explicitly typed and it is intended to be used for attributes that are "intrinsic" to the specific mesh type. For instance, the position attribute is intrinsic to polygonal or tetrahedral meshes and point clouds. Intrinsic attributes define the geometry of the mesh type.

Methods

impl<T, I> IntrinsicAttribute<T, I>[src]

pub fn with_size(n: usize, def: T) -> Self where
    T: Clone
[src]

Construct an attribute with a given size.

pub fn from_vec(vec: Vec<T>) -> Self[src]

Construct an attribute from a given Vec<T> of data reusing the space aready allocated by the Vec.

pub fn from_slice(data: &[T]) -> Self where
    T: Clone
[src]

Construct an attribute from a given slice of data, by copying the data.

pub fn as_slice(&self) -> &[T][src]

Produce a slice to the underlying data.

pub fn as_mut_slice(&mut self) -> &mut [T][src]

Produce a mutable slice to the underlying data.

pub fn into_vec(self) -> Vec<T>[src]

Move the contents of this attribute into a Vec. This is identical to using the Into trait.

pub fn as_mut_vec(&mut self) -> &mut Vec<T>[src]

Get the internal Vec storing the attribute data. Use this very carefully because it allows the user to modify the size of the internal vector which may violate intrinsic properties of the mesh that this attribute is part of.

pub fn clone_into_vec(&self) -> Vec<T> where
    T: Clone
[src]

Convert the data stored by this attribute into a vector of the same size.

pub fn copy_into_vec(&self) -> Vec<T> where
    T: Copy
[src]

Convert the data stored by this attribute into a vector of the same size. This function is similar to clone_into_vec but assumes that elements are Copy. It may also be more performant than clone_into_vec.

pub fn iter(&self) -> Iter<T>[src]

Produce an iterator over the underlying data elements.

pub fn iter_mut(&mut self) -> IterMut<T>[src]

Produce a mutable iterator over the underlying data elements.

pub fn len(&self) -> usize[src]

Number of elements stored by this attribute. This is the same as the number of elements in the associated topology.

pub fn is_empty(&self) -> bool[src]

Check if there are any values in this attribute.

Trait Implementations

impl<T, I> From<Vec<T>> for IntrinsicAttribute<T, I>[src]

impl<T, I> Into<Vec<T>> for IntrinsicAttribute<T, I>[src]

impl<T, I> IntoIterator for IntrinsicAttribute<T, I>[src]

type Item = T

The type of the elements being iterated over.

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?

impl<T: Clone, I: Clone> Clone for IntrinsicAttribute<T, I>[src]

impl<T: PartialEq, I: PartialEq> PartialEq<IntrinsicAttribute<T, I>> for IntrinsicAttribute<T, I>[src]

impl<T: Debug, I: Debug> Debug for IntrinsicAttribute<T, I>[src]

impl<T, I: Into<usize>, J: Into<I>> Index<J> for IntrinsicAttribute<T, I>[src]

type Output = T

The returned type after indexing.

impl<T, I: Into<usize>, J: Into<I>> IndexMut<J> for IntrinsicAttribute<T, I>[src]

impl<T, I> StructuralPartialEq for IntrinsicAttribute<T, I>[src]

impl<T, I> FromIterator<T> for IntrinsicAttribute<T, I>[src]

Auto Trait Implementations

impl<T, I> Send for IntrinsicAttribute<T, I> where
    I: Send,
    T: Send

impl<T, I> Sync for IntrinsicAttribute<T, I> where
    I: Sync,
    T: Sync

impl<T, I> Unpin for IntrinsicAttribute<T, I> where
    I: Unpin,
    T: Unpin

impl<T, I> UnwindSafe for IntrinsicAttribute<T, I> where
    I: UnwindSafe,
    T: UnwindSafe

impl<T, I> RefUnwindSafe for IntrinsicAttribute<T, I> where
    I: RefUnwindSafe,
    T: RefUnwindSafe

Blanket Implementations

impl<T> Bytes for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]