Handle removing a node, and a shard disconnecting (bulk remove)

This commit is contained in:
James Wilson
2021-06-25 17:21:24 +01:00
parent 4f60453689
commit 89dfad5bbe
6 changed files with 350 additions and 81 deletions
+6 -1
View File
@@ -1,4 +1,4 @@
use std::hash::Hash;
use std::{fmt::Display, hash::Hash};
use serde::{Serialize,Deserialize};
use bimap::BiMap;
@@ -15,6 +15,11 @@ impl std::convert::From<usize> for Id {
Id(n)
}
}
impl Display for Id {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.0.fmt(f)
}
}
/// A struct that allows you to assign an ID to an arbitrary set of
/// details (so long as they are Eq+Hash+Clone), and then access