Struct sliding_puzzle::SlidingPuzzle[][src]

pub struct SlidingPuzzle<T> { /* fields omitted */ }

Implementations

impl<T: Clone + Default + PartialEq> SlidingPuzzle<T>[src]

pub fn new(slice_2d: &[&[T]]) -> Result<Self, SlidingPuzzleError>[src]

pub fn tiles(&self) -> Vec<Vec<T>>[src]

pub fn get(&self, row: usize, column: usize) -> Option<&T>[src]

pub fn position(&self, tile: &T) -> Option<(usize, usize)>[src]

pub fn moves(&self) -> Vec<Direction>[src]

pub fn slide(&self, direction: &Direction) -> Result<Self, SlidingPuzzleError>[src]

pub fn slide_mut(
    &mut self,
    direction: &Direction
) -> Result<&mut Self, SlidingPuzzleError>
[src]

pub fn slide_unchecked(&self, direction: &Direction) -> Self[src]

pub fn slide_mut_unchecked(&mut self, direction: &Direction) -> &mut Self[src]

pub fn scramble(&self, number_of_moves: usize) -> Self[src]

pub fn in_bounds(&self, row: usize, column: usize) -> bool[src]

pub fn move_is_valid(&self, direction: &Direction) -> bool[src]

pub fn blank_is_on_the_left(&self) -> bool[src]

pub fn blank_is_on_the_right(&self) -> bool[src]

pub fn blank_is_on_the_top(&self) -> bool[src]

pub fn blank_is_on_the_bottom(&self) -> bool[src]

pub fn remove<U: PartialEq>(
    vec: &mut Vec<U>,
    item_option: Option<U>
) -> Option<U>
[src]

impl SlidingPuzzle<u8>[src]

pub fn to_decimal(self) -> Result<u64, SlidingPuzzleError>[src]

pub fn from_decimal(
    d: u64,
    rows: usize,
    columns: usize
) -> Result<Self, SlidingPuzzleError>
[src]

pub fn to_decimal_unchecked(self) -> u64[src]

pub fn from_decimal_unchecked(d: u64, rows: usize, columns: usize) -> Self[src]

Trait Implementations

impl<T: Clone> Clone for SlidingPuzzle<T>[src]

impl<T: Debug> Debug for SlidingPuzzle<T>[src]

impl<T: Eq> Eq for SlidingPuzzle<T>[src]

impl<T: Hash> Hash for SlidingPuzzle<T>[src]

impl<T: PartialEq> PartialEq<SlidingPuzzle<T>> for SlidingPuzzle<T>[src]

impl<T> StructuralEq for SlidingPuzzle<T>[src]

impl<T> StructuralPartialEq for SlidingPuzzle<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for SlidingPuzzle<T> where
    T: RefUnwindSafe

impl<T> Send for SlidingPuzzle<T> where
    T: Send

impl<T> Sync for SlidingPuzzle<T> where
    T: Sync

impl<T> Unpin for SlidingPuzzle<T> where
    T: Unpin

impl<T> UnwindSafe for SlidingPuzzle<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.