pub struct DirectionMap<T> {
pub up: T,
pub left: T,
pub down: T,
pub right: T,
}
Fields§
§up: T
§left: T
§down: T
§right: T
Implementations§
Source§impl<T> DirectionMap<T>
impl<T> DirectionMap<T>
pub fn from_dirs<F>(generator: F) -> DirectionMap<T>
pub fn map<F, U>(self, mapper: F) -> DirectionMap<U>where
F: FnMut(T) -> U,
pub fn map_with_dirs<F, U>(self, mapper: F) -> DirectionMap<U>
pub fn as_ref(&self) -> DirectionMap<&T>
pub fn as_mut(&mut self) -> DirectionMap<&mut T>
Source§impl<'a, T> DirectionMap<&'a T>
impl<'a, T> DirectionMap<&'a T>
pub fn copied(self) -> DirectionMap<T>where
T: Copy,
pub fn cloned(self) -> DirectionMap<T>where
T: Clone,
Source§impl<'a, T> DirectionMap<&'a mut T>
impl<'a, T> DirectionMap<&'a mut T>
pub fn copied(self) -> DirectionMap<T>where
T: Copy,
pub fn cloned(self) -> DirectionMap<T>where
T: Clone,
Source§impl<T> DirectionMap<Option<T>>
impl<T> DirectionMap<Option<T>>
pub fn transpose(self) -> Option<DirectionMap<T>>
pub fn from_transposed(transposed: Option<DirectionMap<T>>) -> Self
Source§impl<T, E> DirectionMap<Result<T, E>>
impl<T, E> DirectionMap<Result<T, E>>
pub fn transpose(self) -> Result<DirectionMap<T>, E>
pub fn from_transposed(transposed: Result<DirectionMap<T>, E>) -> Selfwhere
E: Clone,
Trait Implementations§
Source§impl<T: Clone> Clone for DirectionMap<T>
impl<T: Clone> Clone for DirectionMap<T>
Source§fn clone(&self) -> DirectionMap<T>
fn clone(&self) -> DirectionMap<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for DirectionMap<T>
impl<T: Debug> Debug for DirectionMap<T>
Source§impl<T: Default> Default for DirectionMap<T>
impl<T: Default> Default for DirectionMap<T>
Source§fn default() -> DirectionMap<T>
fn default() -> DirectionMap<T>
Returns the “default value” for a type. Read more
Source§impl From<DirectionFlags> for DirectionMap<bool>
impl From<DirectionFlags> for DirectionMap<bool>
Source§fn from(flags: DirectionFlags) -> Self
fn from(flags: DirectionFlags) -> Self
Converts to this type from the input type.
Source§impl From<DirectionMap<bool>> for DirectionFlags
impl From<DirectionMap<bool>> for DirectionFlags
Source§fn from(map: DirectionMap<bool>) -> Self
fn from(map: DirectionMap<bool>) -> Self
Converts to this type from the input type.
Source§impl<T: Hash> Hash for DirectionMap<T>
impl<T: Hash> Hash for DirectionMap<T>
Source§impl<T> Index<Direction> for DirectionMap<T>
impl<T> Index<Direction> for DirectionMap<T>
Source§impl<T> IndexMut<Direction> for DirectionMap<T>
impl<T> IndexMut<Direction> for DirectionMap<T>
Source§impl<T: Ord> Ord for DirectionMap<T>
impl<T: Ord> Ord for DirectionMap<T>
Source§fn cmp(&self, other: &DirectionMap<T>) -> Ordering
fn cmp(&self, other: &DirectionMap<T>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialEq> PartialEq for DirectionMap<T>
impl<T: PartialEq> PartialEq for DirectionMap<T>
Source§impl<T: PartialOrd> PartialOrd for DirectionMap<T>
impl<T: PartialOrd> PartialOrd for DirectionMap<T>
impl<T: Copy> Copy for DirectionMap<T>
impl<T: Eq> Eq for DirectionMap<T>
impl<T> StructuralPartialEq for DirectionMap<T>
Auto Trait Implementations§
impl<T> Freeze for DirectionMap<T>where
T: Freeze,
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more