diff --git a/src/runtime/mod.rs b/src/runtime/mod.rs index 02501cd4f1ce247d52426c6879306d4eb995a1a5..c501c5fb149eabcfd00091fa4cf9bbbb7d7f95aa 100644 --- a/src/runtime/mod.rs +++ b/src/runtime/mod.rs @@ -16,7 +16,6 @@ pub struct RoundOk { batch_index: usize, gotten: HashMap, } -#[derive(Debug)] pub struct VecSet { // invariant: ordered, deduplicated vec: Vec, @@ -204,12 +203,6 @@ pub struct SyncProtoContext<'a> { inbox: &'a HashMap, } //////////////// -pub fn random_connector_id() -> ConnectorId { - type Bytes8 = [u8; std::mem::size_of::()]; - let mut bytes = Bytes8::default(); - getrandom::getrandom(&mut bytes).unwrap(); - unsafe { std::mem::transmute::(bytes) } -} pub fn would_block(err: &std::io::Error) -> bool { err.kind() == std::io::ErrorKind::WouldBlock } @@ -268,6 +261,12 @@ impl Drop for Connector { } } impl Connector { + fn random_id() -> ConnectorId { + type Bytes8 = [u8; std::mem::size_of::()]; + let mut bytes = Bytes8::default(); + getrandom::getrandom(&mut bytes).unwrap(); + unsafe { std::mem::transmute::(bytes) } + } pub fn swap_logger(&mut self, mut new_logger: Box) -> Box { std::mem::swap(&mut self.unphased.logger, &mut new_logger); new_logger @@ -436,6 +435,11 @@ impl Predicate { self.assigned.get(&var).copied() } } +impl Debug for VecSet { + fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { + f.debug_set().entries(self.vec.iter()).finish() + } +} impl Debug for Predicate { fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { struct MySet<'a>(&'a Predicate, bool); @@ -457,7 +461,6 @@ impl Debug for Predicate { .finish() } } - impl serde::Serialize for SerdeProtocolDescription { fn serialize(&self, serializer: S) -> Result where