1#[derive(Debug, PartialEq, Eq, thiserror::Error)]
3pub enum HlcError {
4 #[error("Out of range timestamp")]
6 OutOfRangeTimestamp,
7
8 #[error("Drift exeeded the maximum allowed: {0} > {1}")]
10 DriftTooLarge(usize, usize),
11
12 #[error("Physical time exceeds maximum value: {0} > {1}")]
14 PhysicalTimeExceedsMax(i64, u64),
15
16 #[error("Logical clock exceeds maximum value: {0} > {1}")]
18 LogicalClockExceedsMax(u64, u64),
19
20 #[error("Timestamp is below the minimum value: {0} < {1}")]
22 TimestampBelowMin(i64, i64),
23}
24
25pub type HlcResult<T> = Result<T, HlcError>;