Struct pasture_core::layout::PointAttributeMember
source · pub struct PointAttributeMember { /* private fields */ }
Expand description
A point attribute within a PointType
structure. This is similar to a PointAttributeDefinition
, but includes the
offset of the member within the structure
Implementations§
source§impl PointAttributeMember
impl PointAttributeMember
sourcepub fn custom(
name: &'static str,
datatype: PointAttributeDataType,
offset: u64,
) -> Self
pub fn custom( name: &'static str, datatype: PointAttributeDataType, offset: u64, ) -> Self
Creates a new custom PointAttributeMember
with the given name, datatype and byte offset
let custom_attribute = PointAttributeMember::custom("Custom", PointAttributeDataType::F32, 8);
sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Returns the name of the associated PointAttributeMember
let custom_attribute = PointAttributeMember::custom("Custom", PointAttributeDataType::F32, 8);
let name = custom_attribute.name();
sourcepub const fn datatype(&self) -> PointAttributeDataType
pub const fn datatype(&self) -> PointAttributeDataType
Returns the datatype of the associated PointAttributeMember
let custom_attribute = PointAttributeMember::custom("Custom", PointAttributeDataType::F32, 0);
let datatype = custom_attribute.datatype();
sourcepub const fn offset(&self) -> u64
pub const fn offset(&self) -> u64
Returns the byte offset of the associated PointAttributeMember
let custom_attribute = PointAttributeMember::custom("Custom", PointAttributeDataType::F32, 8);
let offset = custom_attribute.offset();
sourcepub fn attribute_definition(&self) -> &PointAttributeDefinition
pub fn attribute_definition(&self) -> &PointAttributeDefinition
Returns the underlying PointAttributeDefinition
for the associated PointAttributeMember
sourcepub const fn size(&self) -> u64
pub const fn size(&self) -> u64
Returns the size in bytes of the associated PointAttributeMember
sourcepub fn byte_range_within_point(&self) -> Range<usize>
pub fn byte_range_within_point(&self) -> Range<usize>
Returns the byte range within the PointType
for this attribute
Trait Implementations§
source§impl Clone for PointAttributeMember
impl Clone for PointAttributeMember
source§fn clone(&self) -> PointAttributeMember
fn clone(&self) -> PointAttributeMember
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for PointAttributeMember
impl Debug for PointAttributeMember
source§impl Display for PointAttributeMember
impl Display for PointAttributeMember
source§impl Hash for PointAttributeMember
impl Hash for PointAttributeMember
source§impl PartialEq for PointAttributeMember
impl PartialEq for PointAttributeMember
source§fn eq(&self, other: &PointAttributeMember) -> bool
fn eq(&self, other: &PointAttributeMember) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for PointAttributeMember
impl StructuralPartialEq for PointAttributeMember
Auto Trait Implementations§
impl Freeze for PointAttributeMember
impl RefUnwindSafe for PointAttributeMember
impl Send for PointAttributeMember
impl Sync for PointAttributeMember
impl Unpin for PointAttributeMember
impl UnwindSafe for PointAttributeMember
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
Mutably borrows from an owned value. Read more
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.