pub enum AxisDQ {
N = 0,
NE = 1,
SE = 2,
S = 3,
SW = 4,
NW = 5,
}Expand description
Flat top Directed Hex Direction.
Variants§
Trait Implementations§
Source§impl Axis for AxisDQ
impl Axis for AxisDQ
Source§type Direction = AxisDQ
type Direction = AxisDQ
For tricks to optimize for undirected graph, and not to regress performance of directed graph.
If the axis is
DIRECTED, should set Self.Source§unsafe fn from_index_unchecked(index: usize) -> Self
unsafe fn from_index_unchecked(index: usize) -> Self
Convert form index.
Source§fn backward(self) -> Self::Direction
fn backward(self) -> Self::Direction
To backward direction. It reverses when Axis is
DIRECTED.Source§fn from_direction(dir: Self::Direction) -> Self
fn from_direction(dir: Self::Direction) -> Self
Convert from direction.
Source§const UNDIRECTED_COUNT: usize = _
const UNDIRECTED_COUNT: usize = _
Number of direction. If this axis is not directed, it is
COUNT * 2, otherwise COUNT.Source§fn is_forward_direction(dir: &Self::Direction) -> bool
fn is_forward_direction(dir: &Self::Direction) -> bool
Check the direction is forward for this axis.
Returns true if the direction is
DIRECTED is true, or the index of the axis and direction matches.Source§impl Ord for AxisDQ
impl Ord for AxisDQ
Source§impl PartialOrd for AxisDQ
impl PartialOrd for AxisDQ
impl Copy for AxisDQ
impl Eq for AxisDQ
impl StructuralPartialEq for AxisDQ
Auto Trait Implementations§
impl Freeze for AxisDQ
impl RefUnwindSafe for AxisDQ
impl Send for AxisDQ
impl Sync for AxisDQ
impl Unpin for AxisDQ
impl UnwindSafe for AxisDQ
Blanket Implementations§
Source§impl<A> AxisDirection for Awhere
A: Axis<Direction = A>,
impl<A> AxisDirection for Awhere
A: Axis<Direction = A>,
Source§fn is_forward(&self) -> bool
fn is_forward(&self) -> bool
👎Deprecated: Use Axis::is_forward_direction instead.
Check this match whith
Axis. It will always return true when Axis is directed.Source§fn dir_to_index(&self) -> usize
fn dir_to_index(&self) -> usize
Convert to index.
Source§unsafe fn dir_from_index_unchecked(index: usize) -> A
unsafe fn dir_from_index_unchecked(index: usize) -> A
Convert from index.
Source§fn dir_from_index(index: usize) -> Option<A>
fn dir_from_index(index: usize) -> Option<A>
Convert from index.
Source§fn is_backward(&self) -> bool
fn is_backward(&self) -> bool
👎Deprecated: Use !Axis::is_forward_direction instead.
Check this doesn’t match whith
Axis. It will always return false when Axis is directed.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<T> ConstOrValue<T> for T
impl<T> ConstOrValue<T> for T
Source§const IS_CONST_WRAP: bool = false
const IS_CONST_WRAP: bool = false
get wheter the type is const generic wrapper.
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.