pub struct Coordinate3d<T> {
pub x: T,
pub y: T,
pub z: T,
}Expand description
Standard 3D Cartesian Coordinate
Fields§
§x: T§y: T§z: TImplementations§
Source§impl<T: Integer + Copy> Coordinate3d<T>
impl<T: Integer + Copy> Coordinate3d<T>
Sourcepub fn neighbours(&self) -> Vec<Self>
pub fn neighbours(&self) -> Vec<Self>
Returns all co-ordinates directly neighbouring the point in 3D space along X/Y/Z axes
Sourcepub fn extended_neighbours(&self) -> Vec<Self>
pub fn extended_neighbours(&self) -> Vec<Self>
Returns all co-ordinates directly neighbouring the point in 3D space including diagonals
Sourcepub fn manhattan_distance(&self, other: &Self) -> T
pub fn manhattan_distance(&self, other: &Self) -> T
Taxicab / manhattan distance: difference between X coordinates plus difference between Y coordinates plus difference between Z coordinates
Trait Implementations§
Source§impl<T: Add<Output = T>> Add for Coordinate3d<T>
impl<T: Add<Output = T>> Add for Coordinate3d<T>
Source§impl<T: AddAssign> AddAssign for Coordinate3d<T>
impl<T: AddAssign> AddAssign for Coordinate3d<T>
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+= operation. Read moreSource§impl<T: Clone> Clone for Coordinate3d<T>
impl<T: Clone> Clone for Coordinate3d<T>
Source§fn clone(&self) -> Coordinate3d<T>
fn clone(&self) -> Coordinate3d<T>
Returns a duplicate 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 Coordinate3d<T>
impl<T: Debug> Debug for Coordinate3d<T>
Source§impl<T: Display> Display for Coordinate3d<T>
Renders Coordinate as (x,y,z)
impl<T: Display> Display for Coordinate3d<T>
Renders Coordinate as (x,y,z)
Source§impl<T: Hash> Hash for Coordinate3d<T>
impl<T: Hash> Hash for Coordinate3d<T>
Source§impl<T: Mul<Output = T> + Copy> Mul<T> for Coordinate3d<T>
impl<T: Mul<Output = T> + Copy> Mul<T> for Coordinate3d<T>
Source§type Output = Coordinate3d<T>
type Output = Coordinate3d<T>
The resulting type after applying the
* operator.Source§fn mul(self, n: T) -> Coordinate3d<T>
fn mul(self, n: T) -> Coordinate3d<T>
Performs the
* operation. Read moreSource§impl<T: Ord> Ord for Coordinate3d<T>
impl<T: Ord> Ord for Coordinate3d<T>
Source§fn cmp(&self, other: &Coordinate3d<T>) -> Ordering
fn cmp(&self, other: &Coordinate3d<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 Coordinate3d<T>
impl<T: PartialEq> PartialEq for Coordinate3d<T>
Source§impl<T: PartialOrd> PartialOrd for Coordinate3d<T>
impl<T: PartialOrd> PartialOrd for Coordinate3d<T>
Source§impl<T: Sub<Output = T>> Sub for Coordinate3d<T>
impl<T: Sub<Output = T>> Sub for Coordinate3d<T>
Source§impl<T: SubAssign> SubAssign for Coordinate3d<T>
impl<T: SubAssign> SubAssign for Coordinate3d<T>
Source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the
-= operation. Read moreimpl<T: Copy> Copy for Coordinate3d<T>
impl<T: Eq> Eq for Coordinate3d<T>
impl<T> StructuralPartialEq for Coordinate3d<T>
Auto Trait Implementations§
impl<T> Freeze for Coordinate3d<T>where
T: Freeze,
impl<T> RefUnwindSafe for Coordinate3d<T>where
T: RefUnwindSafe,
impl<T> Send for Coordinate3d<T>where
T: Send,
impl<T> Sync for Coordinate3d<T>where
T: Sync,
impl<T> Unpin for Coordinate3d<T>where
T: Unpin,
impl<T> UnwindSafe for Coordinate3d<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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.