Skip to main content

cells_html

Function cells_html 

Source
pub fn cells_html(
    columns: &[Column<'_>],
    cells: &[Cell<'_>],
    opts: &Emit,
) -> String
Expand description

A row’s cells, in column order.

Ordered by the columns and not by the cells, so a row cannot silently disagree with its table about what comes where. A column with no cell gets an empty container, which keeps the grid aligned; a cell naming no column is dropped, because there is nowhere to put it.

Emits the cells alone, not the row element. The row carries the app’s identity and hooks — data-id, a context-menu binding, a tabindex, its state classes — and none of that is describable here.

§Not for a webview’s scroll path

This has no consumer in either webview app, deliberately, and wiring one in would be a mistake worth naming. goingson renders rows through a virtual scroller whose _render calls its row builder synchronously while scrolling; the code’s own comment says scroll events fire at 60Hz+ and that this is the hot path. Reaching Rust from there means an IPC round trip and an await in that loop, per visible range, during a drag.

So this is for the hosts where rendering already happens in Rust: an axum route, and the router when it lands. There the objection does not apply, because nothing crosses a process boundary to reach it. A webview app should take narrowing_css and column_class and keep building its own rows.