Struct GridDataType

Source
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>

Source

pub fn new() -> Self

Function new creates a blank GridDataType

Source

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

Source

pub fn get_data_ref(&self) -> &Vec<NanoVec<CellDataType>>

Function get_data_ref returns a reference to the data inside the grid

Source

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

Source

pub fn get_data_mut_slice(&mut self) -> &mut [NanoVec<CellDataType>]

Source

pub fn get_data_copy(&self) -> Vec<NanoVec<CellDataType>>

Source

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>

Source§

fn clone(&self) -> GridDataType<CellDataType>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<CellDataType: Debug + Clone + Encodeable> Debug for GridDataType<CellDataType>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<CellDataType: Default + Clone + Encodeable> Default for GridDataType<CellDataType>

Source§

fn default() -> GridDataType<CellDataType>

Returns the “default value” for a type. Read more
Source§

impl<CellDataType: Clone + Encodeable> Display for GridDataType<CellDataType>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.