Struct lattice_graph::lattice_abstract::square::SquareDiagonalShape
source · [−]pub struct SquareDiagonalShape<E = Undirected> { /* private fields */ }
Expand description
Shape for lattice graph with Square and Diagonal Edge.
Implementations
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
type Axis = SquareDiagonalAxis
type Axis = SquareDiagonalAxis
Axis of the lattice.
type Coordinate = SquareOffset
type Coordinate = SquareOffset
Coordinate of the lattice graph.
type OffsetConvertError = ()
type OffsetConvertError = ()
Error to return when to_offset
fails.
Should set Infallible
when the graph is looped and never to fail. Read more
type CoordinateMoveError = ()
type CoordinateMoveError = ()
Error to return when move_coord
fails.
Should set Infallible
when the graph is looped and never to fail. Read more
Horizontal node count.
Convert coordinate to Offset
.
Convert coordinate to Offset without a check.
Convert coordinate from Offset
.
fn move_coord(
&self,
coord: Self::Coordinate,
dir: DirectedSquareDiagonalAxis
) -> Result<Self::Coordinate, Self::CoordinateMoveError>
fn move_coord(
&self,
coord: Self::Coordinate,
dir: DirectedSquareDiagonalAxis
) -> Result<Self::Coordinate, Self::CoordinateMoveError>
Move coordinates to the next coordinate in the direction.
Coordinate should be a valid coordinate and should be checked before using move_coord
.
This is because the target coordinate might be valid even thought the souce coord is invalid,
and some code validate the direction by moveing the coord. Read more
Node count.
Convert coordinate from index.
Covert coordinate to index.
Convert index to offset.
Covert offset to index.
Edge count of horizontal. May differ by the axis info.
Edge count of vertical. May differ by the axis info.
unsafe fn move_coord_unchecked(
&self,
coord: Self::Coordinate,
dir: <Self::Axis as Axis>::Direction
) -> Self::Coordinate
unsafe fn move_coord_unchecked(
&self,
coord: Self::Coordinate,
dir: <Self::Axis as Axis>::Direction
) -> Self::Coordinate
Move coordinates to the next coordinate in the direction. Caller should be sure that the source and the target coord is valid coord. Read more
Check whether two coordinate is in neighbor.
fn get_direction(
&self,
source: Self::Coordinate,
target: Self::Coordinate
) -> Option<<Self::Axis as Axis>::Direction>
fn get_direction(
&self,
source: Self::Coordinate,
target: Self::Coordinate
) -> Option<<Self::Axis as Axis>::Direction>
Get direction if two coordiante is in neighbor.
type Axis = DirectedSquareDiagonalAxis
type Axis = DirectedSquareDiagonalAxis
Axis of the lattice.
type Coordinate = SquareOffset
type Coordinate = SquareOffset
Coordinate of the lattice graph.
type OffsetConvertError = ()
type OffsetConvertError = ()
Error to return when to_offset
fails.
Should set Infallible
when the graph is looped and never to fail. Read more
type CoordinateMoveError = ()
type CoordinateMoveError = ()
Error to return when move_coord
fails.
Should set Infallible
when the graph is looped and never to fail. Read more
Horizontal node count.
Convert coordinate to Offset
.
Convert coordinate to Offset without a check.
Convert coordinate from Offset
.
fn move_coord(
&self,
coord: Self::Coordinate,
dir: DirectedSquareDiagonalAxis
) -> Result<Self::Coordinate, Self::CoordinateMoveError>
fn move_coord(
&self,
coord: Self::Coordinate,
dir: DirectedSquareDiagonalAxis
) -> Result<Self::Coordinate, Self::CoordinateMoveError>
Move coordinates to the next coordinate in the direction.
Coordinate should be a valid coordinate and should be checked before using move_coord
.
This is because the target coordinate might be valid even thought the souce coord is invalid,
and some code validate the direction by moveing the coord. Read more
Node count.
Convert coordinate from index.
Covert coordinate to index.
Convert index to offset.
Covert offset to index.
Edge count of horizontal. May differ by the axis info.
Edge count of vertical. May differ by the axis info.
unsafe fn move_coord_unchecked(
&self,
coord: Self::Coordinate,
dir: <Self::Axis as Axis>::Direction
) -> Self::Coordinate
unsafe fn move_coord_unchecked(
&self,
coord: Self::Coordinate,
dir: <Self::Axis as Axis>::Direction
) -> Self::Coordinate
Move coordinates to the next coordinate in the direction. Caller should be sure that the source and the target coord is valid coord. Read more
Check whether two coordinate is in neighbor.
fn get_direction(
&self,
source: Self::Coordinate,
target: Self::Coordinate
) -> Option<<Self::Axis as Axis>::Direction>
fn get_direction(
&self,
source: Self::Coordinate,
target: Self::Coordinate
) -> Option<<Self::Axis as Axis>::Direction>
Get direction if two coordiante is in neighbor.
Auto Trait Implementations
impl<E> RefUnwindSafe for SquareDiagonalShape<E> where
E: RefUnwindSafe,
impl<E> Send for SquareDiagonalShape<E> where
E: Send,
impl<E> Sync for SquareDiagonalShape<E> where
E: Sync,
impl<E> Unpin for SquareDiagonalShape<E> where
E: Unpin,
impl<E> UnwindSafe for SquareDiagonalShape<E> where
E: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
get wheter the type is const generic wrapper.
Compare self to key
and return true
if they are equal.