use crate::types::ProtocolErrorKind;
use std::fmt;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ProtocolError {
kind: ProtocolErrorKind,
}
impl ProtocolError {
#[must_use]
#[inline]
pub fn new(kind: ProtocolErrorKind) -> Self {
Self { kind }
}
#[must_use]
#[inline]
pub fn kind(&self) -> ProtocolErrorKind {
self.kind
}
}
impl fmt::Display for ProtocolError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "NERVE ProtocolError: {:?}", self.kind)
}
}
impl std::error::Error for ProtocolError {}