[][src]Struct nonogrid::board::Board

pub struct Board<B> where
    B: Block
{ /* fields omitted */ }

Methods

impl<B> Board<B> where
    B: Block,
    B::Color: Copy
[src]

pub fn with_descriptions(
    rows: Vec<Description<B>>,
    columns: Vec<Description<B>>
) -> Self
[src]

pub fn with_descriptions_and_palette(
    rows: Vec<Description<B>>,
    columns: Vec<Description<B>>,
    palette: Option<ColorPalette>
) -> Self
[src]

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]

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]

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]

pub fn set_cached_solution(
    &mut self,
    is_column: bool,
    key: CacheKey<B>,
    solved: CacheValue<B>
)
[src]

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]

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]

pub fn set_callback_on_set_line<CB: 'static + Fn(bool, usize) + Send + Sync>(
    &mut self,
    f: CB
)
[src]

pub fn set_callback_on_restore<CB: 'static + Fn() + Send + Sync>(
    &mut self,
    f: CB
)
[src]

pub fn set_callback_on_change_color<CB: 'static + Fn(Point) + Send + Sync>(
    &mut self,
    f: CB
)
[src]

pub fn set_row_with_callback(
    board_ref: MutRc<Self>,
    index: usize,
    new: &[B::Color]
)
[src]

pub fn set_column_with_callback(
    board_ref: MutRc<Self>,
    index: usize,
    new: &[B::Color]
)
[src]

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]

pub fn unset_color_with_callback(
    board_ref: MutRc<Self>,
    point: &Point,
    color: &B::Color
) -> Result<(), String>
[src]

Trait Implementations

impl<B> Clone for Board<B> where
    B: Block
[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl<B> !Send for Board<B>

impl<B> !Sync for Board<B>

Blanket Implementations

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.

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

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

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