[−][src]Struct spatial_slice::Space
A Space represents a rectangular 2 dimensional array of contiguous dynamically allocated memory
Methods
impl<T> Space<T>
[src]
pub fn new(value: T, width: usize, height: usize) -> Self where
T: Clone,
[src]
T: Clone,
Creates a space full of the provided value, with the provided dimensions
pub fn width(&self) -> usize
[src]
pub fn height(&self) -> usize
[src]
pub fn get(&self, x: usize, y: usize) -> Option<&T>
[src]
Creates an immutable reference to an element at an absolute position in the space If the position specified is outside the space None is returned
pub fn get_mut(&mut self, x: usize, y: usize) -> Option<&mut T>
[src]
Creates a mutable reference to an element at an absolute position in the space If the position specified is outside the space None is returned
pub fn set(&mut self, x: usize, y: usize, value: T) -> bool
[src]
Sets the value for the specified absolute position in the space If the position specified is outside the space false is returned
pub fn as_slice_mut(&mut self) -> SpaceSliceMut<T>
[src]
Create a mutable slice representing the entire space
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
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,