[−][src]Struct nonogrid::board::Board
Methods
impl<B> Board<B> where
B: Block,
B::Color: Copy,
[src]
B: Block,
B::Color: Copy,
pub fn with_descriptions(
rows: Vec<Description<B>>,
columns: Vec<Description<B>>
) -> Self
[src]
rows: Vec<Description<B>>,
columns: Vec<Description<B>>
) -> Self
pub fn with_descriptions_and_palette(
rows: Vec<Description<B>>,
columns: Vec<Description<B>>,
palette: Option<ColorPalette>
) -> Self
[src]
rows: Vec<Description<B>>,
columns: Vec<Description<B>>,
palette: Option<ColorPalette>
) -> Self
pub fn desc_by_id(&self, id: ColorId) -> Option<ColorDesc>
[src]
pub fn iter_rows(&self) -> impl Iterator<Item = &[B::Color]>
[src]
pub fn descriptions(&self, rows: bool) -> &[ReadRc<Description<B>>]
[src]
pub fn height(&self) -> usize
[src]
pub fn width(&self) -> usize
[src]
pub fn is_solved_full(&self) -> bool
[src]
pub fn get_row(&self, index: usize) -> Vec<B::Color>
[src]
pub fn get_column(&self, index: usize) -> Vec<B::Color>
[src]
pub fn line_solution_rate<'a>(
&self,
line: impl Iterator<Item = &'a B::Color>,
size: usize
) -> f64 where
B::Color: 'a,
[src]
&self,
line: impl Iterator<Item = &'a B::Color>,
size: usize
) -> f64 where
B::Color: 'a,
How many cells in a line are known to be of particular color
pub fn row_solution_rate(&self, index: usize) -> f64
[src]
How many cells in the row with given index are known to be of particular color
pub fn column_solution_rate(&self, index: usize) -> f64
[src]
How many cells in the column with given index are known to be of particular color
pub fn solution_rate(&self) -> f64
[src]
How many cells in the whole grid are known to be of particular color
pub fn unsolved_cells(&self) -> impl Iterator<Item = Point> + '_
[src]
pub fn cell(&self, point: &Point) -> B::Color
[src]
pub fn unsolved_neighbours(
&self,
point: &Point
) -> impl Iterator<Item = Point> + '_
[src]
&self,
point: &Point
) -> impl Iterator<Item = Point> + '_
For the given cell yield the neighbour cells that are not completely solved yet.
pub fn init_cache(&mut self)
[src]
pub fn cached_solution(
&mut self,
is_column: bool,
key: &CacheKey<B>
) -> Option<CacheValue<B>>
[src]
&mut self,
is_column: bool,
key: &CacheKey<B>
) -> Option<CacheValue<B>>
pub fn set_cached_solution(
&mut self,
is_column: bool,
key: CacheKey<B>,
solved: CacheValue<B>
)
[src]
&mut self,
is_column: bool,
key: CacheKey<B>,
solved: CacheValue<B>
)
pub fn print_cache_info(&self)
[src]
pub fn row_cache_index(&self, row_index: usize) -> usize
[src]
pub fn column_cache_index(&self, column_index: usize) -> usize
[src]
impl<B> Board<B> where
B: Block,
[src]
B: Block,
pub fn diff(&self, other: &[B::Color]) -> (Vec<Point>, Vec<Point>)
[src]
Difference between two boards as coordinates of changed cells. Standard diff semantic as result:
- first returned points which set in current board and unset in the other
- second returned points which unset in current board and set in the other
pub fn make_snapshot(&self) -> Vec<B::Color>
[src]
impl<B> Board<B> where
B: Block,
[src]
B: Block,
pub fn set_callback_on_set_line<CB: 'static + Fn(bool, usize) + Send + Sync>(
&mut self,
f: CB
)
[src]
&mut self,
f: CB
)
pub fn set_callback_on_restore<CB: 'static + Fn() + Send + Sync>(
&mut self,
f: CB
)
[src]
&mut self,
f: CB
)
pub fn set_callback_on_change_color<CB: 'static + Fn(Point) + Send + Sync>(
&mut self,
f: CB
)
[src]
&mut self,
f: CB
)
pub fn set_row_with_callback(
board_ref: MutRc<Self>,
index: usize,
new: &[B::Color]
)
[src]
board_ref: MutRc<Self>,
index: usize,
new: &[B::Color]
)
pub fn set_column_with_callback(
board_ref: MutRc<Self>,
index: usize,
new: &[B::Color]
)
[src]
board_ref: MutRc<Self>,
index: usize,
new: &[B::Color]
)
pub fn restore_with_callback(board_ref: MutRc<Self>, cells: Vec<B::Color>)
[src]
pub fn set_color_with_callback(
board_ref: MutRc<Self>,
point: &Point,
color: &B::Color
)
[src]
board_ref: MutRc<Self>,
point: &Point,
color: &B::Color
)
pub fn unset_color_with_callback(
board_ref: MutRc<Self>,
point: &Point,
color: &B::Color
) -> Result<(), String>
[src]
board_ref: MutRc<Self>,
point: &Point,
color: &B::Color
) -> Result<(), String>
Trait Implementations
Auto Trait Implementations
Blanket Implementations
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.
fn to_owned(&self) -> T
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,