(&self, max_log_format_version: u8, checksum_algorithm: u8)
| 71 | } |
| 72 | |
| 73 | pub fn ensure_compatible(&self, max_log_format_version: u8, checksum_algorithm: u8) -> Result<(), String> { |
| 74 | if self.log_format_version > max_log_format_version { |
| 75 | return Err(format!("unsupported log format version: {}", self.log_format_version)); |
| 76 | } |
| 77 | if self.checksum_algorithm != checksum_algorithm { |
| 78 | return Err(format!("unsupported checksum algorithm: {}", self.checksum_algorithm)); |
| 79 | } |
| 80 | |
| 81 | Ok(()) |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | impl Default for Header { |
no test coverage detected