Skip to main content

cells_html_placed

Function cells_html_placed 

Source
pub fn cells_html_placed(
    columns: &[Column<'_>],
    cells: &[Cell<'_>],
    opts: &Emit,
    out: &mut String,
    placed: &mut Vec<Placed>,
)
Expand description

A row’s cells, saying where each column’s block landed.

Byte-identical to cells_html_into, and it appends one entry to placed per column, in column order: the offsets in out between which that column’s whole <div> was written.

§Who this is for

A caller compiling a described screen into a template, which has to know which bytes of a row a particular cell produced. Finding that out by searching the output for the content is the thing it exists to avoid: a cell’s markup may appear twice in a row, and a cell that renders to nothing cannot be searched for at all. So the writer says where it wrote, which is the only source that cannot be wrong.

Nothing about the markup changes, and a caller not compiling anything should call cells_html_into and pay nothing for this.