Skip to main content

upsert

Function upsert 

Source
pub fn upsert(path: &Path, entry: &NewEntry) -> Result<Written>
Expand description

Writes an entry into the user’s library, replacing one already declared under the same id.

Nothing outside the one list item is touched, so the comments a user wrote around their entries survive. A comment sitting inside the entry being rewritten does not, which is the price of not reserialising the document.

A builtin cannot be changed where it lives, inside the binary. Writing it here under its own id is enough: the loader shadows by id, so the user’s copy wins.