pub trait GridMut: Grid {
// Required method
unsafe fn get_unchecked_mut(
&mut self,
location: Location
) -> &mut Self::Item;
// Provided method
fn get_mut(
&mut self,
location: impl LocationLike
) -> Result<&mut Self::Item, BoundsError> { ... }
}
Required Methods§
sourceunsafe fn get_unchecked_mut(&mut self, location: Location) -> &mut Self::Item
unsafe fn get_unchecked_mut(&mut self, location: Location) -> &mut Self::Item
Get a mutable reference to a cell, without doing bounds checking.
Implementors of this method are allowed to assume that bounds checking
has already been performed on the location, which means that
implementors are allowed to do their own unsafe get_mut
operations
on the underlying storage, where relevant / possible.
Safety
Callers must ensure that the location has been bounds-checked before
calling this method. The safe interface to GridMut
automatically
performs this checking for you.
Provided Methods§
sourcefn get_mut(
&mut self,
location: impl LocationLike
) -> Result<&mut Self::Item, BoundsError>
fn get_mut( &mut self, location: impl LocationLike ) -> Result<&mut Self::Item, BoundsError>
Get a reference to a cell in a grid. Returns an error if the location is out of bounds with the specific boundary violation.
Object Safety§
This trait is not object safe.