Struct sliding_puzzle::SlidingPuzzle [−][src]
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]
&mut self,
direction: &Direction
) -> Result<&mut Self, SlidingPuzzleError>
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]
vec: &mut Vec<U>,
item_option: Option<U>
) -> Option<U>
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]
d: u64,
rows: usize,
columns: usize
) -> Result<Self, SlidingPuzzleError>
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]
fn clone(&self) -> SlidingPuzzle<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[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]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: PartialEq> PartialEq<SlidingPuzzle<T>> for SlidingPuzzle<T>
[src]
fn eq(&self, other: &SlidingPuzzle<T>) -> bool
[src]
fn ne(&self, other: &SlidingPuzzle<T>) -> bool
[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,
T: RefUnwindSafe,
impl<T> Send for SlidingPuzzle<T> where
T: Send,
T: Send,
impl<T> Sync for SlidingPuzzle<T> where
T: Sync,
T: Sync,
impl<T> Unpin for SlidingPuzzle<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for SlidingPuzzle<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,