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