Struct pasture_core::containers::InterleavedPointView [−][src]
A non-owning view for a contiguous slice of interleaved point data. This is like InterleavedVecPointBuffer
, but it
does not own the point data. It is useful for passing around point data in an untyped but safe manner, for example in
I/O heavy code.
Implementations
impl<'d> InterleavedPointView<'d>
[src]
pub fn from_slice<T: PointType>(points: &'d [T]) -> Self
[src]
Creates a new InterleavedPointView
referencing the given slice of points
#[repr(C)] #[derive(PointType)] struct MyPointType(#[pasture(BUILTIN_INTENSITY)] u16); let points = vec![MyPointType(42), MyPointType(43)]; let view = InterleavedPointView::from_slice(points.as_slice());
pub fn from_raw_slice(points: &'d [u8], layout: PointLayout) -> Self
[src]
Creates a new InterleavedPointView
referencing the given slice of untyped point data
pub fn get_typed_data<T: PointType>(&self) -> &'d [T]
[src]
Returns the data for the points of the associated InterleavedPointView
as a typed slice.
Panics
If the PointLayout
of the view does not match the layout of type T
#[repr(C)] #[derive(Debug, Copy, Clone, PartialEq, Eq, PointType)] struct MyPointType(#[pasture(BUILTIN_INTENSITY)] u16); let points = vec![MyPointType(42), MyPointType(43)]; let view = InterleavedPointView::from_slice(points.as_slice()); let points_ref = view.get_typed_data::<MyPointType>(); assert_eq!(points_ref, points.as_slice());
Trait Implementations
impl<'d> InterleavedPointBuffer for InterleavedPointView<'d>
[src]
fn get_raw_point_ref(&self, point_index: usize) -> &[u8]
[src]
fn get_raw_points_ref(&self, index_range: Range<usize>) -> &[u8]
[src]
impl<'d> PointBuffer for InterleavedPointView<'d>
[src]
fn get_raw_point(&self, point_index: usize, buf: &mut [u8])
[src]
fn get_raw_attribute(
&self,
point_index: usize,
attribute: &PointAttributeDefinition,
buf: &mut [u8]
)
[src]
&self,
point_index: usize,
attribute: &PointAttributeDefinition,
buf: &mut [u8]
)
fn get_raw_points(&self, index_range: Range<usize>, buf: &mut [u8])
[src]
fn get_raw_attribute_range(
&self,
index_range: Range<usize>,
attribute: &PointAttributeDefinition,
buf: &mut [u8]
)
[src]
&self,
index_range: Range<usize>,
attribute: &PointAttributeDefinition,
buf: &mut [u8]
)
fn len(&self) -> usize
[src]
fn point_layout(&self) -> &PointLayout
[src]
fn as_interleaved(&self) -> Option<&dyn InterleavedPointBuffer>
[src]
fn is_empty(&self) -> bool
[src]
fn as_per_attribute(&self) -> Option<&dyn PerAttributePointBuffer>
[src]
Auto Trait Implementations
impl<'d> RefUnwindSafe for InterleavedPointView<'d>
impl<'d> Send for InterleavedPointView<'d>
impl<'d> Sync for InterleavedPointView<'d>
impl<'d> Unpin for InterleavedPointView<'d>
impl<'d> UnwindSafe for InterleavedPointView<'d>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,