Skip to main content

update

Function update 

Source
pub fn update(
    ctx: &Context,
    req: UpdateRequest,
) -> Result<Outcome<PantryContents>, CoreError>
Expand description

Change an item already in the pantry and write it back.

Only the attributes set on the request are changed; the rest of the item is left as it was. There is no way to clear an attribute — None means “leave it”, not “remove it” — so an item is cleared by removing and adding it.

Returns the pantry as it now stands on disk, and any warnings from parsing what was there before.

Only the entry asked for is touched; see what a write touches.

§Errors