Struct meshx::attrib::IntrinsicAttribute
source · pub struct IntrinsicAttribute<T, I> { /* private fields */ }
Expand description
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.
Implementations§
source§impl<T, I> IntrinsicAttribute<T, I>
impl<T, I> IntrinsicAttribute<T, I>
sourcepub fn with_size(n: usize, def: T) -> Selfwhere
T: Clone,
pub fn with_size(n: usize, def: T) -> Selfwhere
T: Clone,
Construct an attribute with a given size.
sourcepub fn from_vec(vec: Vec<T>) -> Self
pub fn from_vec(vec: Vec<T>) -> Self
Construct an attribute from a given Vec<T>
of data reusing the space aready
allocated by the Vec
.
sourcepub fn from_slice(data: &[T]) -> Selfwhere
T: Clone,
pub fn from_slice(data: &[T]) -> Selfwhere
T: Clone,
Construct an attribute from a given slice of data, by copying the data.
sourcepub fn as_mut_slice(&mut self) -> &mut [T]
pub fn as_mut_slice(&mut self) -> &mut [T]
Produce a mutable slice to the underlying data.
sourcepub fn into_vec(self) -> Vec<T>
pub fn into_vec(self) -> Vec<T>
Move the contents of this attribute into a Vec
. This is identical to using the Into
trait.
sourcepub fn as_mut_vec(&mut self) -> &mut Vec<T>
pub fn as_mut_vec(&mut self) -> &mut Vec<T>
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.
sourcepub fn clone_into_vec(&self) -> Vec<T>where
T: Clone,
pub fn clone_into_vec(&self) -> Vec<T>where
T: Clone,
Convert the data stored by this attribute into a vector of the same size.
sourcepub fn copy_into_vec(&self) -> Vec<T>where
T: Copy,
pub fn copy_into_vec(&self) -> Vec<T>where
T: Copy,
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
.
sourcepub fn iter_mut(&mut self) -> IterMut<'_, T>
pub fn iter_mut(&mut self) -> IterMut<'_, T>
Produce a mutable iterator over the underlying data elements.
Trait Implementations§
source§impl<T: Clone, I: Clone> Clone for IntrinsicAttribute<T, I>
impl<T: Clone, I: Clone> Clone for IntrinsicAttribute<T, I>
source§fn clone(&self) -> IntrinsicAttribute<T, I>
fn clone(&self) -> IntrinsicAttribute<T, I>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<T, I> From<IntrinsicAttribute<T, I>> for Vec<T>
impl<T, I> From<IntrinsicAttribute<T, I>> for Vec<T>
source§fn from(val: IntrinsicAttribute<T, I>) -> Self
fn from(val: IntrinsicAttribute<T, I>) -> Self
source§impl<T, I> From<Vec<T>> for IntrinsicAttribute<T, I>
impl<T, I> From<Vec<T>> for IntrinsicAttribute<T, I>
source§impl<T, I> FromIterator<T> for IntrinsicAttribute<T, I>
impl<T, I> FromIterator<T> for IntrinsicAttribute<T, I>
source§fn from_iter<J>(iter: J) -> Selfwhere
J: IntoIterator<Item = T>,
fn from_iter<J>(iter: J) -> Selfwhere
J: IntoIterator<Item = T>,
source§impl<T, I> IntoIterator for IntrinsicAttribute<T, I>
impl<T, I> IntoIterator for IntrinsicAttribute<T, I>
source§impl<T: PartialEq, I: PartialEq> PartialEq for IntrinsicAttribute<T, I>
impl<T: PartialEq, I: PartialEq> PartialEq for IntrinsicAttribute<T, I>
source§fn eq(&self, other: &IntrinsicAttribute<T, I>) -> bool
fn eq(&self, other: &IntrinsicAttribute<T, I>) -> bool
self
and other
values to be equal, and is used
by ==
.impl<T, I> StructuralPartialEq for IntrinsicAttribute<T, I>
Auto Trait Implementations§
impl<T, I> RefUnwindSafe for IntrinsicAttribute<T, I>where
I: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, I> Send for IntrinsicAttribute<T, I>
impl<T, I> Sync for IntrinsicAttribute<T, I>
impl<T, I> Unpin for IntrinsicAttribute<T, I>
impl<T, I> UnwindSafe for IntrinsicAttribute<T, I>where
I: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneBytes for Twhere
T: Clone + 'static,
impl<T> CloneBytes for Twhere
T: Clone + 'static,
unsafe fn clone_bytes(src: &[MaybeUninit<u8>]) -> Box<[MaybeUninit<u8>]>
unsafe fn clone_from_bytes(dst: &mut [MaybeUninit<u8>], src: &[MaybeUninit<u8>])
unsafe fn clone_into_raw_bytes( src: &[MaybeUninit<u8>], dst: &mut [MaybeUninit<u8>] )
source§impl<T> DebugBytes for Twhere
T: Debug + 'static,
impl<T> DebugBytes for Twhere
T: Debug + 'static,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<T> DropBytes for Twhere
T: 'static,
impl<T> DropBytes for Twhere
T: 'static,
unsafe fn drop_bytes(bytes: &mut [MaybeUninit<u8>])
source§impl<'a, S, I> Get<'a, I> for Swhere
I: GetIndex<'a, S>,
impl<'a, S, I> Get<'a, I> for Swhere
I: GetIndex<'a, S>,
type Output = <I as GetIndex<'a, S>>::Output
fn get(&self, idx: I) -> Option<<I as GetIndex<'a, S>>::Output>
source§fn at(&self, idx: I) -> Self::Output
fn at(&self, idx: I) -> Self::Output
get
that will panic if the equivalent get
call is None
,
which typically means that the given index is out of bounds. Read moresource§unsafe fn at_unchecked(&self, idx: I) -> Self::Output
unsafe fn at_unchecked(&self, idx: I) -> Self::Output
source§impl<S, I> Isolate<I> for Swhere
I: IsolateIndex<S>,
impl<S, I> Isolate<I> for Swhere
I: IsolateIndex<S>,
source§impl<T> PartialEqBytes for Twhere
T: PartialEq + 'static,
impl<T> PartialEqBytes for Twhere
T: PartialEq + 'static,
unsafe fn eq_bytes(a: &[MaybeUninit<u8>], b: &[MaybeUninit<u8>]) -> bool
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T, N> PushArrayToVec<N> for T
impl<T, N> PushArrayToVec<N> for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.