// tag::stationary[]
/// Get a stationary grid
/// Return `None` if self is already stationary or a `Some(grid)` with a new, stationary grid.
///
/// This function returns an Option<Grid>, since it cannot return self which was not moved
/// into the function.
:stationary[]
Get a stationary grid
Return `None` if self is already stationary or a `Some(grid)` with a new, stationary grid.

This function returns an Option, since it cannot return self which was not moved
into the function.
: stationary [] Get a stationary grid Return ` None ` if self is already stationary or a ` Some ( grid ) ` with a new stationary grid . This function returns an Option since it cannot return self which was not moved into the function .
pub fn stationary(&self, depth: usize, threshold: usize) -> Option<Grid> {
        // if grid is already stationary return `None`
        let mut grid = match self.update(depth, threshold) {
            Some(grid) => grid,
            None => return None,
        };
        // update grid until it is stationary
        loop {
            grid = match grid.update(depth, threshold) {
                Some(grid) => grid,
                None => break,
            };
        };
        // return stationary grid
        Some(grid)
    }
pub fn stationary ( & self , depth : usize , threshold : usize ) -> Option < Grid > { // if grid is already stationary return `None` let mut grid = match self . update ( depth , threshold ) { Some ( grid ) => grid , None => return None , } ; // update grid until it is stationary loop { grid = match grid . update ( depth , threshold ) { Some ( grid ) => grid , None => break , } ; } ; // return stationary grid Some ( grid ) }
tag::stationary[]
Get a stationary grid
Return `None` if self is already stationary or a `Some(grid)` with a new, stationary grid.
tag :: stationary [] Get a stationary grid Return ` None ` if self is already stationary or a ` Some ( grid ) ` with a new stationary grid .
&self
depth
usize
threshold
usize