Struct lattice_graph::lattice_abstract::square::SquareShape
source · [−]pub struct SquareShape<E = Undirected> { /* private fields */ }
Expand description
Shape for Square Graph.
Implementations
Trait Implementations
Returns the “default value” for a type. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
type Axis = SquareAxis
type Axis = SquareAxis
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
Convert coordinate to Offset
.
Convert coordinate to Offset without a check.
Convert coordinate from Offset
.
Horizontal node count.
Edge count of horizontal. May differ by the axis info.
Edge count of vertical. May differ by the axis info.
fn move_coord(
&self,
coord: SquareOffset,
dir: DirectedSquareAxis
) -> Result<SquareOffset, ()>
fn move_coord(
&self,
coord: SquareOffset,
dir: DirectedSquareAxis
) -> Result<SquareOffset, ()>
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.
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 = DirectedSquareAxis
type Axis = DirectedSquareAxis
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 from Offset
.
fn move_coord(
&self,
coord: Self::Coordinate,
dir: DirectedSquareAxis
) -> Result<Self::Coordinate, Self::CoordinateMoveError>
fn move_coord(
&self,
coord: Self::Coordinate,
dir: DirectedSquareAxis
) -> 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 to Offset without a check.
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 SquareShape<E> where
E: RefUnwindSafe,
impl<E> Send for SquareShape<E> where
E: Send,
impl<E> Sync for SquareShape<E> where
E: Sync,
impl<E> Unpin for SquareShape<E> where
E: Unpin,
impl<E> UnwindSafe for SquareShape<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.