[−][src]Struct beehive::DirectionMap
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]
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]
F: FnMut(Direction) -> T,
Construct a DirectionMap<T>
with values provided from a FnMut(Direction) -> T
.
Trait Implementations
impl<T: Clone> Clone for DirectionMap<T>
[src]
fn clone(&self) -> DirectionMap<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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]
fn default() -> DirectionMap<T>
[src]
impl<'de, T> Deserialize<'de> for DirectionMap<T> where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<T: Eq> Eq for DirectionMap<T>
[src]
impl<T: Hash> Hash for DirectionMap<T>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T> Index<Direction> for DirectionMap<T>
[src]
impl<T> IndexMut<Direction> for DirectionMap<T>
[src]
impl<T: Ord> Ord for DirectionMap<T>
[src]
fn cmp(&self, other: &DirectionMap<T>) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<T: PartialEq> PartialEq<DirectionMap<T>> for DirectionMap<T>
[src]
fn eq(&self, other: &DirectionMap<T>) -> bool
[src]
fn ne(&self, other: &DirectionMap<T>) -> bool
[src]
impl<T: PartialOrd> PartialOrd<DirectionMap<T>> for DirectionMap<T>
[src]
fn partial_cmp(&self, other: &DirectionMap<T>) -> Option<Ordering>
[src]
fn lt(&self, other: &DirectionMap<T>) -> bool
[src]
fn le(&self, other: &DirectionMap<T>) -> bool
[src]
fn gt(&self, other: &DirectionMap<T>) -> bool
[src]
fn ge(&self, other: &DirectionMap<T>) -> bool
[src]
impl<T> Serialize for DirectionMap<T> where
T: Serialize,
[src]
T: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
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,
T: RefUnwindSafe,
impl<T> Send for DirectionMap<T> where
T: Send,
T: Send,
impl<T> Sync for DirectionMap<T> where
T: Sync,
T: Sync,
impl<T> Unpin for DirectionMap<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for DirectionMap<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> 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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,