Skip to main content

discard_pristine

Function discard_pristine 

Source
pub async fn discard_pristine<S: Storage>(storage: &S) -> Result<Discarded>
Expand description

Remove a container nothing was ever written into, so a launch and a quit leave the documents directory as they found it.

Deliberately timid: an empty manifest is necessary but not sufficient, and only a container holding exactly what Container::create laid down is removed. Anything else — a row, an asset, a file the user put beside the manifest — and the container stays, because deleting something we did not write every part of is not ours to decide. The caller narrows this further: only a container this session created is ever offered.

§Errors

The read or the removal that did not work.