pub struct Sqrid<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> {}
Expand description
Sqrid base “factory” type
This struct holds all the generic const parameters required by the other structs. This can be aliased and used as a pseudo-module to ease the creation of the other entites and use of algorithms like BFS.
Implementations§
source§impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> Sqrid<W, H, D, WORDS, SIZE>
impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> Sqrid<W, H, D, WORDS, SIZE>
source§impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> Sqrid<W, H, D, WORDS, SIZE>
impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> Sqrid<W, H, D, WORDS, SIZE>
source§impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> Sqrid<W, H, D, WORDS, SIZE>
impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> Sqrid<W, H, D, WORDS, SIZE>
sourcepub fn astar_path<F>(
go: F,
orig: &Pos<W, H>,
dest: &Pos<W, H>
) -> Result<Vec<Dir>, Error>
pub fn astar_path<F>( go: F, orig: &Pos<W, H>, dest: &Pos<W, H> ) -> Result<Vec<Dir>, Error>
Perform an A* search;
see astar
sourcepub fn astar_path_grid<F>(
go: F,
orig: &Pos<W, H>,
dest: &Pos<W, H>
) -> Result<Vec<Dir>, Error>
pub fn astar_path_grid<F>( go: F, orig: &Pos<W, H>, dest: &Pos<W, H> ) -> Result<Vec<Dir>, Error>
source§impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> Sqrid<W, H, D, WORDS, SIZE>
impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> Sqrid<W, H, D, WORDS, SIZE>
sourcepub fn bf_iter<GoFn>(
go: GoFn,
orig: &Pos<W, H>
) -> BfIterator<GoFn, Gridbool<W, H, WORDS>, W, H, D, WORDS, SIZE> ⓘ
pub fn bf_iter<GoFn>( go: GoFn, orig: &Pos<W, H> ) -> BfIterator<GoFn, Gridbool<W, H, WORDS>, W, H, D, WORDS, SIZE> ⓘ
Create new breadth-first iterator;
see bf
sourcepub fn bf_iter_grid<GoFn>(
go: GoFn,
orig: &Pos<W, H>
) -> BfIterator<GoFn, Gridbool<W, H, WORDS>, W, H, D, WORDS, SIZE> ⓘ
pub fn bf_iter_grid<GoFn>( go: GoFn, orig: &Pos<W, H> ) -> BfIterator<GoFn, Gridbool<W, H, WORDS>, W, H, D, WORDS, SIZE> ⓘ
sourcepub fn bf_iter_hash<GoFn>(
go: GoFn,
orig: &Pos<W, H>
) -> BfIterator<GoFn, HashSet<Pos<W, H>>, W, H, D, WORDS, SIZE> ⓘ
pub fn bf_iter_hash<GoFn>( go: GoFn, orig: &Pos<W, H> ) -> BfIterator<GoFn, HashSet<Pos<W, H>>, W, H, D, WORDS, SIZE> ⓘ
source§impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> Sqrid<W, H, D, WORDS, SIZE>
impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> Sqrid<W, H, D, WORDS, SIZE>
sourcepub fn bfs_path<GoFn, FoundFn>(
go: GoFn,
orig: &Pos<W, H>,
found: FoundFn
) -> Result<(Pos<W, H>, Vec<Dir>), Error>
pub fn bfs_path<GoFn, FoundFn>( go: GoFn, orig: &Pos<W, H>, found: FoundFn ) -> Result<(Pos<W, H>, Vec<Dir>), Error>
Perform a breadth-first search;
see bf
sourcepub fn bfs_path_grid<GoFn, FoundFn>(
go: GoFn,
orig: &Pos<W, H>,
found: FoundFn
) -> Result<(Pos<W, H>, Vec<Dir>), Error>
pub fn bfs_path_grid<GoFn, FoundFn>( go: GoFn, orig: &Pos<W, H>, found: FoundFn ) -> Result<(Pos<W, H>, Vec<Dir>), Error>
source§impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> Sqrid<W, H, D, WORDS, SIZE>
impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> Sqrid<W, H, D, WORDS, SIZE>
sourcepub fn ucs_path<F>(
go: F,
orig: &Pos<W, H>,
dest: &Pos<W, H>
) -> Result<Vec<Dir>, Error>
pub fn ucs_path<F>( go: F, orig: &Pos<W, H>, dest: &Pos<W, H> ) -> Result<Vec<Dir>, Error>
Perform a uniform-cost search;
see ucs
.
sourcepub fn ucs_path_grid<F>(
go: F,
orig: &Pos<W, H>,
dest: &Pos<W, H>
) -> Result<Vec<Dir>, Error>
pub fn ucs_path_grid<F>( go: F, orig: &Pos<W, H>, dest: &Pos<W, H> ) -> Result<Vec<Dir>, Error>
Trait Implementations§
source§impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> Clone for Sqrid<W, H, D, WORDS, SIZE>
impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> Clone for Sqrid<W, H, D, WORDS, SIZE>
source§impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> Debug for Sqrid<W, H, D, WORDS, SIZE>
impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> Debug for Sqrid<W, H, D, WORDS, SIZE>
source§impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> Default for Sqrid<W, H, D, WORDS, SIZE>
impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> Default for Sqrid<W, H, D, WORDS, SIZE>
impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> Copy for Sqrid<W, H, D, WORDS, SIZE>
Auto Trait Implementations§
impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> RefUnwindSafe for Sqrid<W, H, D, WORDS, SIZE>
impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> Send for Sqrid<W, H, D, WORDS, SIZE>
impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> Sync for Sqrid<W, H, D, WORDS, SIZE>
impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> Unpin for Sqrid<W, H, D, WORDS, SIZE>
impl<const W: u16, const H: u16, const D: bool, const WORDS: usize, const SIZE: usize> UnwindSafe for Sqrid<W, H, D, WORDS, SIZE>
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