pub struct Board { /* private fields */ }
Expand description
The board struct
Implementations§
Source§impl Board
impl Board
Sourcepub fn new(
value: Vec<char>,
width: usize,
length: usize,
score: Option<isize>,
) -> Self
pub fn new( value: Vec<char>, width: usize, length: usize, score: Option<isize>, ) -> Self
returns new board instance by given char vector and board width, length and score
Sourcepub fn new_random(width: usize, length: usize) -> Self
pub fn new_random(width: usize, length: usize) -> Self
generate a random board by given width and length
pub fn copy(&self) -> Self
pub fn to_string(&self) -> String
pub fn hash(&self) -> String
Auto Trait Implementations§
impl Freeze for Board
impl RefUnwindSafe for Board
impl Send for Board
impl Sync for Board
impl Unpin for Board
impl UnwindSafe for Board
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more