(bytes: &[u8])
| 7 | const ATOM_CHANGE_FILE_VERSION_SPAN: u32 = atomic_core::change::format_v3::SPAN_FORMAT_VERSION; |
| 8 | |
| 9 | fn atom_change_file_version(bytes: &[u8]) -> Result<u32, RepositoryError> { |
| 10 | if bytes.len() < ATOM_CHANGE_FILE_HEADER_LEN { |
| 11 | return Err(RepositoryError::Serialization(format!( |
| 12 | "change object is too short for an ATOM file header: expected at least {ATOM_CHANGE_FILE_HEADER_LEN} bytes, found {}", |
| 13 | bytes.len() |
| 14 | ))); |
| 15 | } |
| 16 | if &bytes[..4] != ATOM_CHANGE_MAGIC { |
| 17 | return Err(RepositoryError::Serialization( |
| 18 | "change object does not begin with ATOM file-header magic".to_string(), |
| 19 | )); |
| 20 | } |
| 21 | Ok(u32::from_le_bytes([bytes[4], bytes[5], bytes[6], bytes[7]])) |
| 22 | } |
| 23 | |
| 24 | impl Repository { |
| 25 | fn require_projected_semantic_storage_capability( |
no test coverage detected