[][src]Struct spatial_slice::Space

pub struct Space<T> { /* fields omitted */ }

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]

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

impl<T> Send for Space<T> where
    T: Send

impl<T> Sync for Space<T> where
    T: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]