#[repr(C)]pub struct LVArray<const D: usize, T> { /* private fields */ }
Expand description
Internal LabVIEW array representation.
todo: does this follow cluster packing rules? yes but lots breaks.
Implementations§
Source§impl<const D: usize, T> LVArray<D, T>
implement a basic, unsafe API that works for packed usage on 32 bit targets.
impl<const D: usize, T> LVArray<D, T>
implement a basic, unsafe API that works for packed usage on 32 bit targets.
It is copy only as we must copy out of the pointers.
Sourcepub fn dimension_sizes(&self) -> LVArrayDims<D>
pub fn dimension_sizes(&self) -> LVArrayDims<D>
Get the dimensions of the array.
Sourcepub fn element_count(&self) -> usize
pub fn element_count(&self) -> usize
Get the total number of elements in the array across all dimensions.
Sourcepub unsafe fn get_value_unchecked(&self, index: usize) -> T
pub unsafe fn get_value_unchecked(&self, index: usize) -> T
Get the value directly from the array. This is an unsafe method used on 32 bit targets where the packed structure means we cannot access a slice.
On 64 bit targets use LVArray::data_as_slice
instead.
§Safety
If the index is out of the range then it is undefined behaviour.
Sourcepub unsafe fn set_value_unchecked(&mut self, index: usize, value: T)
pub unsafe fn set_value_unchecked(&mut self, index: usize, value: T)
Set the value at the index. This is an unsafe method used on 32 bit targets where the packed structure means we cannot access a slice.
On 64 bit targets use LVArray::data_as_slice_mut
instead.
§Safety
If the index is out of range then it is undefined behaviour.
Source§impl<const D: usize, T> LVArray<D, T>
impl<const D: usize, T> LVArray<D, T>
Sourcepub fn data_as_slice(&self) -> &[T]
pub fn data_as_slice(&self) -> &[T]
Get the data component as a slice.
Note: for muti-dimension arrays this is a raw structure so you will need to understand the dimenisons and data ordering.
For 1D arrays this can just be used as the data contents.
Sourcepub fn data_as_slice_mut(&mut self) -> &mut [T]
pub fn data_as_slice_mut(&mut self) -> &mut [T]
Get the data component as a mutable slice.
Note: for multi-dimension arrays this is a raw structure so you will need to understand the dimensions and data ordering.
For 1D arrays this can just be used as the data contents.