Struct aoc_pos::PosGeoHexLat
source · pub struct PosGeoHexLat<Val> {
pub nw: Val,
pub e: Val,
}
Fields§
§nw: Val
§e: Val
Implementations§
source§impl<Val: Int> PosGeoHexLat<Val>
impl<Val: Int> PosGeoHexLat<Val>
pub const fn new(nw: Val, e: Val) -> Self
pub const ZERO: Self = _
pub const MIN: Self = _
pub const MAX: Self = _
pub fn south_east(self, num: Val) -> NumResult<Self>
pub fn north_west(self, num: Val) -> NumResult<Self>
pub fn west(self, num: Val) -> NumResult<Self>
pub fn east(self, num: Val) -> NumResult<Self>
source§impl<Val: Int> PosGeoHexLat<Val>
impl<Val: Int> PosGeoHexLat<Val>
pub fn north_east(&self, num: Val) -> NumResult<Self>
pub fn south_west(&self, num: Val) -> NumResult<Self>
pub fn adjacent(&self) -> TinyVec<Self, 6>where Val: Int,
Trait Implementations§
source§impl<Val, ArgVal: Int> Add<PosGeoHexLat<ArgVal>> for PosGeoHexLat<Val>where
Val: TryAdd<ArgVal, Output = Val> + Int,
impl<Val, ArgVal: Int> Add<PosGeoHexLat<ArgVal>> for PosGeoHexLat<Val>where Val: TryAdd<ArgVal, Output = Val> + Int,
§type Output = PosGeoHexLat<Val>
type Output = PosGeoHexLat<Val>
The resulting type after applying the
+
operator.source§fn add(self, other: PosGeoHexLat<ArgVal>) -> Self
fn add(self, other: PosGeoHexLat<ArgVal>) -> Self
Performs the
+
operation. Read moresource§impl<Val, ArgVal: Int> AddAssign<PosGeoHexLat<ArgVal>> for PosGeoHexLat<Val>where
Val: TryAdd<ArgVal, Output = Val> + Int,
impl<Val, ArgVal: Int> AddAssign<PosGeoHexLat<ArgVal>> for PosGeoHexLat<Val>where Val: TryAdd<ArgVal, Output = Val> + Int,
source§fn add_assign(&mut self, other: PosGeoHexLat<ArgVal>)
fn add_assign(&mut self, other: PosGeoHexLat<ArgVal>)
Performs the
+=
operation. Read moresource§impl<Val: Clone> Clone for PosGeoHexLat<Val>
impl<Val: Clone> Clone for PosGeoHexLat<Val>
source§fn clone(&self) -> PosGeoHexLat<Val>
fn clone(&self) -> PosGeoHexLat<Val>
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<Val: Int> Debug for PosGeoHexLat<Val>
impl<Val: Int> Debug for PosGeoHexLat<Val>
source§impl<Val: Int> Default for PosGeoHexLat<Val>
impl<Val: Int> Default for PosGeoHexLat<Val>
source§impl<Val: Int> From<PosGeoHexLat<Val>> for [Val; 2]
impl<Val: Int> From<PosGeoHexLat<Val>> for [Val; 2]
source§fn from(pos: PosGeoHexLat<Val>) -> Self
fn from(pos: PosGeoHexLat<Val>) -> Self
Converts to this type from the input type.
source§impl<Val: Int> GenPos<2> for PosGeoHexLat<Val>
impl<Val: Int> GenPos<2> for PosGeoHexLat<Val>
source§impl<Val: Hash> Hash for PosGeoHexLat<Val>
impl<Val: Hash> Hash for PosGeoHexLat<Val>
source§impl<Val: Int> Mul<Val> for PosGeoHexLat<Val>
impl<Val: Int> Mul<Val> for PosGeoHexLat<Val>
source§impl<Val: Ord> Ord for PosGeoHexLat<Val>
impl<Val: Ord> Ord for PosGeoHexLat<Val>
source§fn cmp(&self, other: &PosGeoHexLat<Val>) -> Ordering
fn cmp(&self, other: &PosGeoHexLat<Val>) -> 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<Val: PartialEq> PartialEq<PosGeoHexLat<Val>> for PosGeoHexLat<Val>
impl<Val: PartialEq> PartialEq<PosGeoHexLat<Val>> for PosGeoHexLat<Val>
source§fn eq(&self, other: &PosGeoHexLat<Val>) -> bool
fn eq(&self, other: &PosGeoHexLat<Val>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<Val: PartialOrd> PartialOrd<PosGeoHexLat<Val>> for PosGeoHexLat<Val>
impl<Val: PartialOrd> PartialOrd<PosGeoHexLat<Val>> for PosGeoHexLat<Val>
source§fn partial_cmp(&self, other: &PosGeoHexLat<Val>) -> Option<Ordering>
fn partial_cmp(&self, other: &PosGeoHexLat<Val>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<Val: Int> Rem<PosGeoHexLat<Val>> for PosGeoHexLat<Val>
impl<Val: Int> Rem<PosGeoHexLat<Val>> for PosGeoHexLat<Val>
§type Output = PosGeoHexLat<Val>
type Output = PosGeoHexLat<Val>
The resulting type after applying the
%
operator.source§fn rem(self, other: PosGeoHexLat<Val>) -> Self
fn rem(self, other: PosGeoHexLat<Val>) -> Self
Performs the
%
operation. Read moresource§impl<Val, ArgVal: Int> Sub<PosGeoHexLat<ArgVal>> for PosGeoHexLat<Val>where
Val: TrySub<ArgVal, Output = Val> + Int,
impl<Val, ArgVal: Int> Sub<PosGeoHexLat<ArgVal>> for PosGeoHexLat<Val>where Val: TrySub<ArgVal, Output = Val> + Int,
§type Output = PosGeoHexLat<Val>
type Output = PosGeoHexLat<Val>
The resulting type after applying the
-
operator.source§fn sub(self, other: PosGeoHexLat<ArgVal>) -> Self
fn sub(self, other: PosGeoHexLat<ArgVal>) -> Self
Performs the
-
operation. Read moresource§impl<Val, ArgVal: Int> TryAdd<PosGeoHexLat<ArgVal>> for PosGeoHexLat<Val>where
Val: TryAdd<ArgVal, Output = Val> + Int,
impl<Val, ArgVal: Int> TryAdd<PosGeoHexLat<ArgVal>> for PosGeoHexLat<Val>where Val: TryAdd<ArgVal, Output = Val> + Int,
type Output = PosGeoHexLat<Val>
fn try_add(self, other: PosGeoHexLat<ArgVal>) -> NumResult<Self>
source§impl<Val, ArgVal: Int> TrySub<PosGeoHexLat<ArgVal>> for PosGeoHexLat<Val>where
Val: TrySub<ArgVal, Output = Val> + Int,
impl<Val, ArgVal: Int> TrySub<PosGeoHexLat<ArgVal>> for PosGeoHexLat<Val>where Val: TrySub<ArgVal, Output = Val> + Int,
type Output = PosGeoHexLat<Val>
fn try_sub(self, other: PosGeoHexLat<ArgVal>) -> NumResult<Self>
impl<Val: Copy> Copy for PosGeoHexLat<Val>
impl<Val: Eq> Eq for PosGeoHexLat<Val>
impl<Val> StructuralEq for PosGeoHexLat<Val>
impl<Val> StructuralPartialEq for PosGeoHexLat<Val>
Auto Trait Implementations§
impl<Val> RefUnwindSafe for PosGeoHexLat<Val>where Val: RefUnwindSafe,
impl<Val> Send for PosGeoHexLat<Val>where Val: Send,
impl<Val> Sync for PosGeoHexLat<Val>where Val: Sync,
impl<Val> Unpin for PosGeoHexLat<Val>where Val: Unpin,
impl<Val> UnwindSafe for PosGeoHexLat<Val>where Val: 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