[][src]Struct beehive::DirectionMap

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

A stack-allocated map backed by an array that can be indexed by Direction.

This type is only available with the collections feature.

Methods

impl<T: Default> DirectionMap<T>[src]

pub fn new() -> Self[src]

impl<T> DirectionMap<T>[src]

pub fn from_array(arr: [T; 8]) -> Self[src]

Create a DirectionMap from an array.

pub fn into_array(self) -> [T; 8][src]

Returns the underlying array in this DirectionMap.

pub fn as_array(&self) -> &[T; 8][src]

Returns a reference to the underlying array.

pub fn as_mut_array(&mut self) -> &mut [T; 8][src]

Returns a mutable reference to the underlying array.

pub fn as_slice(&self) -> &[T][src]

Returns a reference to the underlying array as a slice.

pub fn as_mut_slice(&mut self) -> &mut [T][src]

Returns a mutable reference to the underlying array as a slice.

pub fn get(&self, dir: Direction) -> &T[src]

Returns a reference to the value corresponding to dir.

pub fn get_mut(&mut self, dir: Direction) -> &mut T[src]

Returns a mutable reference to the value corresponding to dir.

pub fn with_initializer<F>(op: F) -> Self where
    F: FnMut(Direction) -> T, 
[src]

Construct a DirectionMap<T> with values provided from a FnMut(Direction) -> T.

Trait Implementations

impl<T: Clone> Clone for DirectionMap<T>[src]

impl<T: Copy> Copy for DirectionMap<T>[src]

impl<T: Debug> Debug for DirectionMap<T>[src]

impl<T: Default> Default for DirectionMap<T>[src]

impl<'de, T> Deserialize<'de> for DirectionMap<T> where
    T: Deserialize<'de>, 
[src]

impl<T: Eq> Eq for DirectionMap<T>[src]

impl<T: Hash> Hash for DirectionMap<T>[src]

impl<T> Index<Direction> for DirectionMap<T>[src]

type Output = T

The returned type after indexing.

impl<T> IndexMut<Direction> for DirectionMap<T>[src]

impl<T: Ord> Ord for DirectionMap<T>[src]

impl<T: PartialEq> PartialEq<DirectionMap<T>> for DirectionMap<T>[src]

impl<T: PartialOrd> PartialOrd<DirectionMap<T>> for DirectionMap<T>[src]

impl<T> Serialize for DirectionMap<T> where
    T: Serialize
[src]

impl<T> StructuralEq for DirectionMap<T>[src]

impl<T> StructuralPartialEq for DirectionMap<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for DirectionMap<T> where
    T: RefUnwindSafe

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

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

impl<T> Unpin for DirectionMap<T> where
    T: Unpin

impl<T> UnwindSafe for DirectionMap<T> where
    T: UnwindSafe

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.