Struct pasture_core::containers::InterleavedPointView[][src]

pub struct InterleavedPointView<'d> { /* fields omitted */ }

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]

impl<'d> PointBuffer for InterleavedPointView<'d>[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

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

type Error = Infallible

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<V, T> VZip<V> for T where
    V: MultiLane<T>,