use super::{
data::{ClientMsg, DataResponse},
system::NodeMsg,
AntiEntropyMsg, AuthorityProof, ClientAuth,
};
use std::fmt::{Display, Formatter};
#[derive(PartialEq, Debug, Clone)]
#[allow(clippy::large_enum_variant)]
pub enum NetworkMsg {
AntiEntropy(AntiEntropyMsg),
Client {
auth: AuthorityProof<ClientAuth>,
msg: ClientMsg,
},
Node(NodeMsg),
DataResponse(DataResponse),
}
impl Display for NetworkMsg {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
Self::AntiEntropy(msg) => write!(f, "NetworkMsg::AntiEntropy({msg:?})"),
Self::Client { msg, .. } => write!(f, "NetworkMsg::Client({msg})"),
Self::Node(msg) => write!(f, "NetworkMsg::Node({msg})"),
Self::DataResponse(msg) => {
write!(f, "NetworkMsg::DataResponse({msg:?})")
}
}
}
}