pub struct Sudoku {
pub grid: Vec<Vec<Cell>>,
pub size: usize,
pub box_size: usize,
}Fields§
§grid: Vec<Vec<Cell>>§size: usize§box_size: usizeImplementations§
Source§impl Sudoku
impl Sudoku
pub fn new(size: usize) -> Self
pub fn from_string(s: &str, size: usize) -> Result<Self, String>
pub fn get(&self, row: usize, col: usize) -> Option<Cell>
pub fn set(&mut self, row: usize, col: usize, value: u8) -> Result<(), String>
pub fn is_valid(&self) -> bool
pub fn is_valid_rows(&self) -> bool
pub fn is_valid_cols(&self) -> bool
pub fn is_valid_boxes(&self) -> bool
pub fn is_complete(&self) -> bool
pub fn get_candidates(&self, row: usize, col: usize) -> HashSet<u8>
pub fn find_empty_cell(&self) -> Option<(usize, usize)>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Sudoku
impl<'de> Deserialize<'de> for Sudoku
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Sudoku
impl RefUnwindSafe for Sudoku
impl Send for Sudoku
impl Sync for Sudoku
impl Unpin for Sudoku
impl UnwindSafe for Sudoku
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