kacrab_protocol/crc/error.rs
1//! Error types for [`crate::crc`].
2//!
3//! A single failure mode (`expected != actual`) so this is a plain struct,
4//! not the `struct + Kind` shape.
5
6/// CRC32C checksum mismatch.
7#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)]
8#[error("CRC mismatch: expected {expected:#010x}, actual {actual:#010x}")]
9#[non_exhaustive]
10pub struct CrcMismatch {
11 /// CRC value read from the wire.
12 pub expected: u32,
13 /// CRC value computed locally.
14 pub actual: u32,
15}