book

Types

Book

opaque

笔记本

页数为 page_max

pub opaque type Book(content)

Values

pub fn clean(
  book book: Book(content),
  page page: Int,
) -> Book(content)

清空 page 页的所有内容

pub fn erase(
  book book: Book(content),
  page page: Int,
  row row: Int,
  column column: Int,
) -> Book(content)

擦除 page 页 row 行 column 列的单元格内容

pub fn get_cell(
  book book: Book(content),
  page page: Int,
  row row: Int,
  column column: Int,
) -> cell.Cell(content)

获取 page 页 row 行 column 列的单元格

pub fn get_column(
  book book: Book(content),
  page page: Int,
  column column: Int,
) -> List(cell.Cell(content))

获取 page 页 column 列的所有单元格

pub fn get_paper(
  book book: Book(content),
  page page: Int,
) -> paper.Paper(content)

获取指定 page 的纸张

页面不存在则返回空 Paper

pub fn get_row(
  book book: Book(content),
  page page: Int,
  row row: Int,
) -> List(cell.Cell(content))

获取 page 页 row 行的所有单元格

pub fn new() -> Book(content)

创建一本新的空书

pub const page_max: Int

页数 —— 20

pub fn read(
  book book: Book(content),
  page page: Int,
  row row: Int,
  column column: Int,
) -> option.Option(content)

读取指定 page、row 和 column 的单元格内容

pub fn write(
  book book: Book(content),
  page page: Int,
  row row: Int,
  column column: Int,
  content content: content,
) -> Book(content)

在指定 page、row 和 column 的单元格写入内容

这会覆盖旧的内容

Search Document