use std::fmt;
use crate::{NodeId, PosWalk, RandomWalk, WalkStorage};
impl fmt::Debug for NodeId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
NodeId::Int(id) => write!(f, "NodeId::Int({})", id),
NodeId::UInt(id) => write!(f, "NodeId::UInt({})", id),
NodeId::None => write!(f, "NodeId::None"),
}
}
}
impl fmt::Debug for RandomWalk {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "RandomWalk {{ nodes: {:?} }}", self.get_nodes())
}
}
impl fmt::Debug for WalkStorage {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let sorted_walks: std::collections::BTreeMap<_, _> = self.get_walks().iter().collect();
write!(f, "WalkStorage {{ walks: {:?} }}", sorted_walks)
}
}
impl fmt::Debug for PosWalk {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
"PosWalk {{ pos: {:?}, walk: {:?} }}",
self.get_pos(),
self.get_walk()
)
}
}