replace expiration field with custom type that merges to min value

This commit is contained in:
Alex Auvolat
2026-05-13 10:53:56 +02:00
parent bf0a24ea69
commit bacc6c98b2
5 changed files with 25 additions and 9 deletions
+12
View File
@@ -63,3 +63,15 @@ impl Crdt for BucketKeyPerm {
}
}
}
/// Expiration date for a key or token
#[derive(PartialOrd, Ord, PartialEq, Eq, Clone, Copy, Debug, Serialize, Deserialize)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[serde(transparent)]
pub struct ExpirationTime(pub u64);
impl Crdt for ExpirationTime {
fn merge(&mut self, other: &Self) {
self.0 = std::cmp::min(self.0, other.0);
}
}