pub async fn prepare_user_file(
path: &Path,
lease: &FileLease,
progress: impl Fn(u64) + Send + Sync,
) -> Result<PreparedUserFile, DbError>Expand description
Read a user’s original once, recording its whole-file hash and each upload
chunk’s hash from the same bytes, and reporting total bytes read. Changes
during the read are refused; later ones fail its upload, whether it is
staged for the cloud or moved there later. The read holds one place of
lease until it ends (§17.3).