pub struct CardinalValues<T> {
pub east: T,
pub north: T,
pub west: T,
pub south: T,
}
Expand description
A struct which a value assigned to each cardinal. This can be used as a shorthand for accessing arrays.
Fields§
§east: T
The value assigned to east.
north: T
The value assigned to north.
west: T
The value assigned to west.
south: T
The value assigned to south.
Implementations§
Source§impl<T> CardinalValues<T>
impl<T> CardinalValues<T>
Sourcepub fn map<B, F>(self, f: F) -> CardinalValues<B>where
F: FnMut(T) -> B,
pub fn map<B, F>(self, f: F) -> CardinalValues<B>where
F: FnMut(T) -> B,
Converts a CardinalValues from one type to another.
Trait Implementations§
Source§impl<T: Clone> Clone for CardinalValues<T>
impl<T: Clone> Clone for CardinalValues<T>
Source§fn clone(&self) -> CardinalValues<T>
fn clone(&self) -> CardinalValues<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 CardinalValues<T>
impl<T: Debug> Debug for CardinalValues<T>
Source§impl<T: Default> Default for CardinalValues<T>
impl<T: Default> Default for CardinalValues<T>
Source§fn default() -> CardinalValues<T>
fn default() -> CardinalValues<T>
Returns the “default value” for a type. Read more
Source§impl<T: Hash> Hash for CardinalValues<T>
impl<T: Hash> Hash for CardinalValues<T>
Source§impl<T> Index<Cardinal> for CardinalValues<T>
impl<T> Index<Cardinal> for CardinalValues<T>
Source§impl<T: Copy> IntoIterator for CardinalValues<T>
impl<T: Copy> IntoIterator for CardinalValues<T>
Source§impl<T: Ord> Ord for CardinalValues<T>
impl<T: Ord> Ord for CardinalValues<T>
Source§fn cmp(&self, other: &CardinalValues<T>) -> Ordering
fn cmp(&self, other: &CardinalValues<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 CardinalValues<T>
impl<T: PartialEq> PartialEq for CardinalValues<T>
Source§impl<T: PartialOrd> PartialOrd for CardinalValues<T>
impl<T: PartialOrd> PartialOrd for CardinalValues<T>
impl<T: Copy> Copy for CardinalValues<T>
impl<T: Eq> Eq for CardinalValues<T>
impl<T> StructuralPartialEq for CardinalValues<T>
Auto Trait Implementations§
impl<T> Freeze for CardinalValues<T>where
T: Freeze,
impl<T> RefUnwindSafe for CardinalValues<T>where
T: RefUnwindSafe,
impl<T> Send for CardinalValues<T>where
T: Send,
impl<T> Sync for CardinalValues<T>where
T: Sync,
impl<T> Unpin for CardinalValues<T>where
T: Unpin,
impl<T> UnwindSafe for CardinalValues<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