Implement UploadPartCopy

This commit is contained in:
Alex Auvolat
2022-01-11 17:31:09 +01:00
parent 3770a34e3d
commit 6617a72220
7 changed files with 416 additions and 56 deletions
+14
View File
@@ -47,6 +47,20 @@ impl Version {
key,
}
}
pub fn has_part_number(&self, part_number: u64) -> bool {
let case1 = self
.parts_etags
.items()
.binary_search_by(|(k, _)| k.cmp(&part_number))
.is_ok();
let case2 = self
.blocks
.items()
.binary_search_by(|(k, _)| k.part_number.cmp(&part_number))
.is_ok();
case1 || case2
}
}
#[derive(PartialEq, Eq, Clone, Copy, Debug, Serialize, Deserialize)]