pub fn init_from_str(&mut self, cells: &str, cursor: Option<Cursor>) {
        if cells.chars().count() != self.rows * self.columns {
            panic!("Invalid number of cells.");
        }
        if self.cell_width != 1 && self.cell_height != 1 {
            panic!("You can initialize cells from string for board with 1x1 cells only.");
        }
        self.grid.init_from_str(cells);
        self.add_cursor(cursor);
    }
/// Initializes board with cells and cursor (optional).
///
/// The cells will be filled from string by rows.
///
/// This is an additional initialization method. It might be useful if board has 1x1 cells and
/// all cells contain 1 character without styling.
///
/// # Implementation note
///
/// We iterate string using `chars()` method, it iterates through Unicode code points. Do not
/// use Unicode symbols which consist of more than 1 code points.
///
/// # Panics
///
/// Panics `cells` contain wrong number of elements.
///
/// Panics if cell size is not 1x1.
///
/// # Examples
///
/// ```no_run
/// let mut board = Board::new(4, 4, 1, 1, false, None));
/// board.init_from_str(&"x    o    x    o", None);
/// ```
/// The following code does the same.
/// ```no_run
/// let mut board = Board::new(4, 4, 1, 1, false, None));
/// board.init_from_vec(&vec![Cell::Char('x'), Cell::Empty, Cell::Empty, Cell::Empty,
///                           Cell::Empty, Cell::Char('o'), Cell::Empty, Cell::Empty,
///                           Cell::Empty, Cell::Empty, Cell::Char('x'), Cell::Empty,
///                           Cell::Empty, Cell::Empty, Cell::Empty, Cell::Char('o')],
///                     None);
/// ```
Initializes board with cells and cursor (optional).
The cells will be filled from string by rows.

This is an additional initialization method. It might be useful if board has 1x1 cells and
all cells contain 1 character without styling.
Initializes board with cells and cursor ( optional ) . The cells will be filled from string by rows . This is an additional initialization method . It might be useful if board has 1x1 cells and all cells contain 1 character without styling .
pub fn init_from_str(&mut self, cells: &str, cursor: Option<Cursor>) {
        if cells.chars().count() != self.rows * self.columns {
            panic!("Invalid number of cells.");
        }
        if self.cell_width != 1 && self.cell_height != 1 {
            panic!("You can initialize cells from string for board with 1x1 cells only.");
        }
        self.grid.init_from_str(cells);
        self.add_cursor(cursor);
    }
pub fn init_from_str ( & mut self , cells : & str , cursor : Option < Cursor > ) { if cells . chars ( ) . count ( ) != self . rows * self . columns { panic ! ( " " ) ; } if self . cell_width != 1 && self . cell_height != 1 { panic ! ( " " ) ; } self . grid . init_from_str ( cells ) ; self . add_cursor ( cursor ) ; }
Initializes board with cells and cursor (optional).
Initializes board with cells and cursor ( optional ) .
&mut self
cells
&str
cursor
Option<Cursor>
&mut self
cells
&str
cursor
Option<Cursor>
implementation note
We iterate string using `chars()` method, it iterates through Unicode code points. Do not
use Unicode symbols which consist of more than 1 code points.
We iterate string using ` chars () ` method it iterates through Unicode code points . Do not use Unicode symbols which consist of more than 1 code points .
panics
Panics `cells` contain wrong number of elements.

Panics if cell size is not 1x1.
Panics ` cells ` contain wrong number of elements . Panics if cell size is not 1x1 .
examples
```no_run
let mut board = Board::new(4, 4, 1, 1, false, None));
board.init_from_str(&"x    o    x    o", None);
```
The following code does the same.
` ` ` no_run let mut board = Board :: new ( 4 4 1 1 false None )) ; board . init_from_str ( & " x o x o " None ) ; ` ` ` The following code does the same .