#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum LimitKind {
Bytes,
Allocation,
Nodes,
Depth,
Output,
Field,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum Error {
Limit(LimitKind),
Allocation,
Malformed,
Trailing,
Identity,
}
impl core::fmt::Display for Error {
fn fmt(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
formatter.write_str(match self {
Self::Limit(LimitKind::Bytes) => "wire bytes limit",
Self::Limit(LimitKind::Allocation) => "wire allocation limit",
Self::Limit(LimitKind::Nodes) => "wire nodes limit",
Self::Limit(LimitKind::Depth) => "wire depth limit",
Self::Limit(LimitKind::Output) => "wire output limit",
Self::Limit(LimitKind::Field) => "wire field limit",
Self::Allocation => "wire allocation",
Self::Malformed => "wire malformed",
Self::Trailing => "wire trailing",
Self::Identity => "wire identity",
})
}
}
impl core::error::Error for Error {}