Don't use an enum for anchors and model min/max more implicitly

This will make it easier to serialize an anchor.
This commit is contained in:
Antonio Scandurra 2021-12-09 12:00:51 +01:00
parent cbe136c0cb
commit 67686dd1c2
3 changed files with 115 additions and 140 deletions

View file

@ -21,6 +21,15 @@ pub struct Lamport {
}
impl Local {
pub const MIN: Self = Self {
replica_id: ReplicaId::MIN,
value: Seq::MIN,
};
pub const MAX: Self = Self {
replica_id: ReplicaId::MAX,
value: Seq::MAX,
};
pub fn new(replica_id: ReplicaId) -> Self {
Self {
replica_id,