pub struct GridDataType<CellDataType: Clone + Encodeable> {
pub data: Vec<NanoVec<CellDataType>>,
pub dimensions: Vec<usize>,
}
Expand description
GridDataType
is the datatype of the data inside of a grid (the struct Grid is just a wrapper around GridDataType
with a few more functions)
Fields§
§data: Vec<NanoVec<CellDataType>>
Data is just the data of the grid. The data is “flattened” to 1 dimension, no matter how many dimensions the grid is
dimensions: Vec<usize>
Dimensions is a pointer to the dimensions_vec
Implementations§
Source§impl<CellDataType: Clone + Encodeable> GridDataType<CellDataType>
impl<CellDataType: Clone + Encodeable> GridDataType<CellDataType>
Sourcepub fn from_data(data: &[NanoVec<CellDataType>], dims: &[usize]) -> Self
pub fn from_data(data: &[NanoVec<CellDataType>], dims: &[usize]) -> Self
Function from_data
creates a blank GridDataType
from a slice of data and a slice of usize’s representing the dimensions
Sourcepub fn get_data_ref(&self) -> &Vec<NanoVec<CellDataType>>
pub fn get_data_ref(&self) -> &Vec<NanoVec<CellDataType>>
Function get_data_ref
returns a reference to the data inside the grid
Sourcepub fn get_data_mut_ref(&mut self) -> &mut Vec<NanoVec<CellDataType>>
pub fn get_data_mut_ref(&mut self) -> &mut Vec<NanoVec<CellDataType>>
Function get_data_mut_ref
returns a mutable reference to the data inside the grid
pub fn get_data_mut_slice(&mut self) -> &mut [NanoVec<CellDataType>]
pub fn get_data_copy(&self) -> Vec<NanoVec<CellDataType>>
pub fn get_mut_references( &mut self, num_chunks: usize, ) -> Vec<Option<&mut [NanoVec<CellDataType>]>>
Trait Implementations§
Source§impl<CellDataType: Clone + Clone + Encodeable> Clone for GridDataType<CellDataType>
impl<CellDataType: Clone + Clone + Encodeable> Clone for GridDataType<CellDataType>
Source§fn clone(&self) -> GridDataType<CellDataType>
fn clone(&self) -> GridDataType<CellDataType>
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<CellDataType: Debug + Clone + Encodeable> Debug for GridDataType<CellDataType>
impl<CellDataType: Debug + Clone + Encodeable> Debug for GridDataType<CellDataType>
Source§impl<CellDataType: Default + Clone + Encodeable> Default for GridDataType<CellDataType>
impl<CellDataType: Default + Clone + Encodeable> Default for GridDataType<CellDataType>
Source§fn default() -> GridDataType<CellDataType>
fn default() -> GridDataType<CellDataType>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<CellDataType> Freeze for GridDataType<CellDataType>
impl<CellDataType> RefUnwindSafe for GridDataType<CellDataType>where
CellDataType: RefUnwindSafe,
impl<CellDataType> Send for GridDataType<CellDataType>where
CellDataType: Send,
impl<CellDataType> Sync for GridDataType<CellDataType>where
CellDataType: Sync,
impl<CellDataType> Unpin for GridDataType<CellDataType>where
CellDataType: Unpin,
impl<CellDataType> UnwindSafe for GridDataType<CellDataType>where
CellDataType: UnwindSafe,
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