Struct dynamic_grid::DynamicGrid [−][src]
pub struct DynamicGrid<T> { /* fields omitted */ }
Expand description
Dynamic Grid
Implementations
impl<T> DynamicGrid<T> where
T: Clone,
[src]
impl<T> DynamicGrid<T> where
T: Clone,
[src]pub fn init(row: usize, col: usize, value: T) -> Self
[src]
pub fn init(row: usize, col: usize, value: T) -> Self
[src]Init a grid of size rows x columns with the given data element
Arguments
row
- number of rowscol
- number columnsvalue
- default value
pub fn row_size_unchecked(&self, index_row: usize) -> usize
[src]
pub fn row_size_unchecked(&self, index_row: usize) -> usize
[src]Returns the size of the row indicate by the index, without bound checking
Arguments
index
- rows index
pub fn push(&mut self, value: T) -> (usize, usize)
[src]
pub fn push(&mut self, value: T) -> (usize, usize)
[src]push value in the last position of last row
value
- value to push
pub fn push_at_row(
&mut self,
index_row: usize,
value: T
) -> Option<(usize, usize)>
[src]
pub fn push_at_row(
&mut self,
index_row: usize,
value: T
) -> Option<(usize, usize)>
[src]push value in the last position at row mentioned
Argument
- index_row - index of row
- value - value to push
pub fn remove_row(&mut self, index_row: usize)
[src]
pub fn remove_row(&mut self, index_row: usize)
[src]remove the last row
pub unsafe fn get_unchecked(&self, index_row: usize, index_col: usize) -> &T
[src]
pub unsafe fn get_unchecked(&self, index_row: usize, index_col: usize) -> &T
[src]pub unsafe fn get_unchecked_mut(
&mut self,
index_row: usize,
index_col: usize
) -> &mut T
[src]
pub unsafe fn get_unchecked_mut(
&mut self,
index_row: usize,
index_col: usize
) -> &mut T
[src]pub fn iter(&self) -> Iter<'_, T>
[src]
pub fn iter(&self) -> Iter<'_, T>
[src]Returns an iterator over the whole grid, starting from the first row and column.
pub fn iter_mut(&mut self) -> IterMut<'_, T>
[src]
pub fn iter_mut(&mut self) -> IterMut<'_, T>
[src]Returns an mutable iterator over the whole grid that allows modifying each value.
pub fn iter_row_mut(&mut self, index_row: usize) -> IterMut<'_, T>
[src]
pub fn iter_row_mut(&mut self, index_row: usize) -> IterMut<'_, T>
[src]Trait Implementations
impl<T: Clone> Clone for DynamicGrid<T>
[src]
impl<T: Clone> Clone for DynamicGrid<T>
[src]fn clone(&self) -> DynamicGrid<T>
[src]
fn clone(&self) -> DynamicGrid<T>
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl<T: Debug> Debug for DynamicGrid<T>
[src]
impl<T: Debug> Debug for DynamicGrid<T>
[src]impl<T: Default> Default for DynamicGrid<T>
[src]
impl<T: Default> Default for DynamicGrid<T>
[src]fn default() -> DynamicGrid<T>
[src]
fn default() -> DynamicGrid<T>
[src]Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for DynamicGrid<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for DynamicGrid<T> where
T: Send,
T: Send,
impl<T> Sync for DynamicGrid<T> where
T: Sync,
T: Sync,
impl<T> Unpin for DynamicGrid<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for DynamicGrid<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more