pub fn publish(
dir: &Path,
files: &BTreeMap<String, Vec<u8>>,
) -> Result<(), Error>Expand description
Write a package to dir atomically: every file is written and synced in a staging directory
beside it, which is then renamed into place. An existing dir is never replaced — a published
result is immutable — and a failure leaves nothing behind.