Trait pasture_core::containers::UntypedPoint
source · pub trait UntypedPoint {
// Required methods
fn get_raw_attribute<'point>(
&'point self,
attribute: &PointAttributeDefinition
) -> Result<&'point [u8]>;
fn get_raw_attribute_mut<'point>(
&'point mut self,
attribute: &PointAttributeDefinition
) -> Result<&'point mut [u8]>;
fn set_raw_attribute(
&mut self,
attribute: &PointAttributeDefinition,
value_byte_slice: &[u8]
) -> Result<()>;
fn get_attribute<T: PrimitiveType>(
&self,
attribute: &PointAttributeDefinition
) -> Result<T>;
fn set_attribute<T: PrimitiveType>(
&mut self,
attribute: &PointAttributeDefinition,
value: &T
) -> Result<()>;
fn get_layout(&self) -> &PointLayout;
fn get_cursor(&mut self) -> Cursor<&mut [u8]>;
fn get_buffer(&self) -> &[u8] ⓘ;
}
Expand description
A trait to handle points that layout can’t be known to compile time.
Required Methods§
sourcefn get_raw_attribute<'point>(
&'point self,
attribute: &PointAttributeDefinition
) -> Result<&'point [u8]>
fn get_raw_attribute<'point>( &'point self, attribute: &PointAttributeDefinition ) -> Result<&'point [u8]>
Gets the data as byte slice for a attribute of the point.
sourcefn get_raw_attribute_mut<'point>(
&'point mut self,
attribute: &PointAttributeDefinition
) -> Result<&'point mut [u8]>
fn get_raw_attribute_mut<'point>( &'point mut self, attribute: &PointAttributeDefinition ) -> Result<&'point mut [u8]>
Gets the data as mut byte slice for a attribute of the point.
sourcefn set_raw_attribute(
&mut self,
attribute: &PointAttributeDefinition,
value_byte_slice: &[u8]
) -> Result<()>
fn set_raw_attribute( &mut self, attribute: &PointAttributeDefinition, value_byte_slice: &[u8] ) -> Result<()>
Sets the data for a attribute of the point.
sourcefn get_attribute<T: PrimitiveType>(
&self,
attribute: &PointAttributeDefinition
) -> Result<T>
fn get_attribute<T: PrimitiveType>( &self, attribute: &PointAttributeDefinition ) -> Result<T>
Gets the data from an attribute and converts it to an PrimitiveType
.
sourcefn set_attribute<T: PrimitiveType>(
&mut self,
attribute: &PointAttributeDefinition,
value: &T
) -> Result<()>
fn set_attribute<T: PrimitiveType>( &mut self, attribute: &PointAttributeDefinition, value: &T ) -> Result<()>
Sets the data from an attribute with an PrimitiveType
.
sourcefn get_layout(&self) -> &PointLayout
fn get_layout(&self) -> &PointLayout
Get the layout of the point.
fn get_cursor(&mut self) -> Cursor<&mut [u8]>
sourcefn get_buffer(&self) -> &[u8] ⓘ
fn get_buffer(&self) -> &[u8] ⓘ
Access the underlying memory buffer of the untyped point
Object Safety§
This trait is not object safe.