pub enum DirectedSquareDiagonalAxis {
N,
NE,
E,
SE,
S,
SW,
W,
NW,
}Expand description
Axis for lattice graph with Square and Diagonal Edge.
Variants§
Trait Implementations§
Source§impl Axis for DirectedSquareDiagonalAxis
impl Axis for DirectedSquareDiagonalAxis
Source§const UNDIRECTED_COUNT: usize = 8usize
const UNDIRECTED_COUNT: usize = 8usize
Number of direction. If this axis is not directed, it is
COUNT * 2, otherwise COUNT.Source§type Direction = DirectedSquareDiagonalAxis
type Direction = DirectedSquareDiagonalAxis
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 from_index(index: usize) -> Option<Self>
fn from_index(index: usize) -> Option<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§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 Clone for DirectedSquareDiagonalAxis
impl Clone for DirectedSquareDiagonalAxis
Source§fn clone(&self) -> DirectedSquareDiagonalAxis
fn clone(&self) -> DirectedSquareDiagonalAxis
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 Debug for DirectedSquareDiagonalAxis
impl Debug for DirectedSquareDiagonalAxis
Source§impl Hash for DirectedSquareDiagonalAxis
impl Hash for DirectedSquareDiagonalAxis
Source§impl Ord for DirectedSquareDiagonalAxis
impl Ord for DirectedSquareDiagonalAxis
Source§fn cmp(&self, other: &DirectedSquareDiagonalAxis) -> Ordering
fn cmp(&self, other: &DirectedSquareDiagonalAxis) -> 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 PartialOrd for DirectedSquareDiagonalAxis
impl PartialOrd for DirectedSquareDiagonalAxis
impl Copy for DirectedSquareDiagonalAxis
impl Eq for DirectedSquareDiagonalAxis
impl StructuralPartialEq for DirectedSquareDiagonalAxis
Auto Trait Implementations§
impl Freeze for DirectedSquareDiagonalAxis
impl RefUnwindSafe for DirectedSquareDiagonalAxis
impl Send for DirectedSquareDiagonalAxis
impl Sync for DirectedSquareDiagonalAxis
impl Unpin for DirectedSquareDiagonalAxis
impl UnwindSafe for DirectedSquareDiagonalAxis
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.