Skip to main content

append_top_level

Function append_top_level 

Source
pub fn append_top_level(
    text: &str,
    id: &NodeId,
    child: &NewChild,
) -> Result<String, AxError>
Expand description

Appends one top-level row under the plan’s root, returning the whole text.

The row lands after the table’s last line, so a plan with a header and no rows gets its first line. id is the index the caller chose from the plan it read, and it is checked against this text rather than recomputed: a caller that goes on to claim the row it added names it by that index, and renumbering here would point the claim at a row it never wrote.

§Errors

Refuses a table that does not parse or is not there, an id that is not top-level or that a row already carries, and a child the table cannot hold (blank, carrying |, weighted zero).