[][src]Function text_grid::cell

pub fn cell(value: impl Display) -> Cell<impl CellSource>

Create Cell from Display.

The returned value owns the value passed in. Therefore, the returned value can not be move out of the lifetime of the passed value.

This example is not tested
use text_grid::*;

fn f_error() -> Cell<impl CellSource> {
    let s = String::from("ABC");
    cell(&s) // Error : returns a value referencing data owned by the current function
}
use text_grid::*;

fn f_ok() -> Cell<impl CellSource> {
    let s = String::from("ABC");
    cell(s) // OK
}