[−][src]Struct gridly_grids::SparseGrid
Methods
impl<T: Clone + PartialEq> SparseGrid<T>
[src]
pub fn new(dimensions: Vector, default: T) -> Self
[src]
pub fn new_rooted(root: Location, dimensions: Vector, default: T) -> Self
[src]
pub fn get_default(&self) -> &T
[src]
pub fn clean(&mut self)
[src]
Remove all entries from the grid that compare equal to the default
pub fn occuppied_entries(
&self
) -> impl Iterator<Item = (&Location, &T)> + FusedIterator + Clone
[src]
&self
) -> impl Iterator<Item = (&Location, &T)> + FusedIterator + Clone
Get an iterator over all of the occupied entries in the grid, in an arbitrary order.
pub fn occuppied_entries_mut(
&mut self
) -> impl Iterator<Item = (&Location, &mut T)> + FusedIterator
[src]
&mut self
) -> impl Iterator<Item = (&Location, &mut T)> + FusedIterator
Trait Implementations
impl<T: Clone + Clone + PartialEq> Clone for SparseGrid<T>
[src]
fn clone(&self) -> SparseGrid<T>
[src]
default fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Debug + Clone + PartialEq> Debug for SparseGrid<T>
[src]
impl<T: Clone + PartialEq> GridBounds for SparseGrid<T>
[src]
impl<T: Clone + PartialEq> BaseGrid for SparseGrid<T>
[src]
type Item = T
unsafe fn get_unchecked(&self, loc: &Location) -> &T
[src]
impl<T: Clone + PartialEq> BaseGridMut for SparseGrid<T>
[src]
unsafe fn get_unchecked_mut(&mut self, loc: &Location) -> &mut T
[src]
unsafe fn set_unchecked(&mut self, loc: &Location, value: T)
[src]
Auto Trait Implementations
impl<T> Send for SparseGrid<T> where
T: Send,
T: Send,
impl<T> Sync for SparseGrid<T> where
T: Sync,
T: Sync,
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<G> IntoTranspose for G where
G: GridBounds,
[src]
G: GridBounds,
impl<G> GridBoundsExt for G where
G: GridBounds,
[src]
G: GridBounds,
default fn num_rows(&self) -> Rows
[src]
Get the height of the grid in [Rows
]. This value MUST be const for any given grid. Read more
default fn num_columns(&self) -> Columns
[src]
Get the width of the grid, in [Columns
]. This value MUST be const for any given grid. Read more
default fn dimension<C>(&self) -> C where
C: Component,
[src]
C: Component,
Get the height or width of this grid.
default fn root_row(&self) -> Row
[src]
Return the index of the topmost row of this grid. For most grids, this is 0, but some grids may include negatively indexed locations, or even offsets. This value MUST be const for any given grid. Read more
default fn root_column(&self) -> Column
[src]
Return the index of the leftmost column of this grid. For most grids, this is 0, but some grids may include negatively indexed locations, or even offsets. This value MUST be const for any given grid. Read more
default fn root_component<C>(&self) -> C where
C: Component,
[src]
C: Component,
Return the index of the leftmost row or column of this grid.
default fn range<C>(&self) -> Range<C> where
C: Component,
[src]
C: Component,
Get a Range over the row or column indexes
default fn row_range(&self) -> Range<Row>
[src]
A range iterator over all the column indexes in this grid
default fn column_range(&self) -> Range<Column>
[src]
A range iterator over all the row indexes in this grid
default fn check_component<C>(&self, c: C) -> Result<C, RangeError<C>> where
C: Component,
[src]
C: Component,
Check that a Row or a Column is inside the bounds described by this Grid.
default fn component_in_bounds<C>(&self, c: C) -> bool where
C: Component,
[src]
C: Component,
default fn check_location<impl Into>(
&self,
loc: impl Into
) -> Result<Location, LocationRangeError> where
impl Into: Into<Location>,
[src]
&self,
loc: impl Into
) -> Result<Location, LocationRangeError> where
impl Into
Check that a location is inside the bounds of this grid. Read more
default fn location_in_bounds<impl Into>(
&self,
location: impl Into
) -> bool where
impl Into: Into<Location>,
[src]
&self,
location: impl Into
) -> bool where
impl Into
Returns true if a locaton is inside the bounds of this grid.
impl<G> Grid for G where
G: BaseGrid,
[src]
G: BaseGrid,
default fn get<impl Into>(
&self,
location: impl Into
) -> Result<&Self::Item, LocationRangeError> where
impl Into: Into<Location>,
[src]
&self,
location: impl Into
) -> Result<&Self::Item, LocationRangeError> where
impl Into
Get a reference to a cell in a grid. Returns an error if the location is out of bounds with the specific boundary violation. Read more
default fn view<T>(&self) -> View<Self, T> where
T: Component,
[src]
T: Component,
default fn rows(&self) -> View<Self, Row>
[src]
Get a view of a grid's rows
default fn columns(&self) -> View<Self, Column>
[src]
Get a view of a grid's columns
unsafe default fn single_view_unchecked<T>(
&self,
index: T
) -> SingleView<Self, T> where
T: Component,
[src]
&self,
index: T
) -> SingleView<Self, T> where
T: Component,
Get a view of a single row or column in a grid, without bounds checking that row or column index. Read more
unsafe default fn row_unchecked<impl Into>(
&self,
row: impl Into
) -> SingleView<Self, Row> where
impl Into: Into<Row>,
|
[src]
&self,
row: impl Into
) -> SingleView<Self, Row> where
impl Into
Get a view of a single row in a grid, without bounds checking that row's index
unsafe default fn column_unchecked<impl Into>(
&self,
column: impl Into
) -> SingleView<Self, Column> where
impl Into: Into<Column>,
[src]
&self,
column: impl Into
) -> SingleView<Self, Column> where
impl Into
Get a view of a single column in a grid, without bounds checking that column's index
default fn single_view<T>(
&self,
index: T
) -> Result<SingleView<Self, T>, RangeError<T>> where
T: Component,
[src]
&self,
index: T
) -> Result<SingleView<Self, T>, RangeError<T>> where
T: Component,
Get a view of a single row or column in a grid. Returns an error if the index of the row or column is out of bounds for the grid. Read more
default fn row<impl Into>(
&self,
row: impl Into
) -> Result<SingleView<Self, Row>, RangeError<Row>> where
impl Into: Into<Row>,
|
[src]
&self,
row: impl Into
) -> Result<SingleView<Self, Row>, RangeError<Row>> where
impl Into
Get a view of a single row in a grid. Returns an error if the index of the row is out of bounds for the grid. Read more
default fn column<impl Into>(
&self,
column: impl Into
) -> Result<SingleView<Self, Column>, RangeError<Column>> where
impl Into: Into<Column>,
[src]
&self,
column: impl Into
) -> Result<SingleView<Self, Column>, RangeError<Column>> where
impl Into
Get a view of a single column in a grid. Returns an error if the index of the column is out of bounds for the grid. Read more
impl<G> GridMut for G where
G: BaseGridMut,
[src]
G: BaseGridMut,