pub struct Grid { /* private fields */ }Implementations§
Source§impl Grid
impl Grid
pub fn width(&self) -> usize
pub fn height(&self) -> usize
pub fn new_empty(width: usize, height: usize) -> Self
pub fn new(width: usize, height: usize, rocks: Vec<Rock>) -> Self
pub fn checked_new( width: usize, height: usize, rocks: Vec<Rock>, ) -> Result<Self, Vec<Rock>>
Sourcepub fn add_rocks(&mut self, rocks: Vec<Rock>) -> Option<Vec<Rock>>
pub fn add_rocks(&mut self, rocks: Vec<Rock>) -> Option<Vec<Rock>>
Rocks that cannot be inserted are returned
pub fn remove_rocks(&mut self, rocks: &Vec<Rock>)
pub fn is_rock(&self, x: usize, y: usize) -> bool
pub fn capacity(&self) -> Option<usize>
Trait Implementations§
Source§impl<T> ToAdjacencyList<T> for Grid
impl<T> ToAdjacencyList<T> for Grid
fn to_adjacency_list(&self) -> AdjacencyList<T>
Auto Trait Implementations§
impl Freeze for Grid
impl RefUnwindSafe for Grid
impl Send for Grid
impl Sync for Grid
impl Unpin for Grid
impl UnwindSafe for Grid
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