use crate::errors::DensorError;
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum DensorKind {
Residual,
Envelope,
Grammar,
Fusion,
Witness,
Court,
Other,
}
impl DensorKind {
pub fn tag(self) -> &'static str {
match self {
DensorKind::Residual => "residual",
DensorKind::Envelope => "envelope",
DensorKind::Grammar => "grammar",
DensorKind::Fusion => "fusion",
DensorKind::Witness => "witness",
DensorKind::Court => "court",
DensorKind::Other => "other",
}
}
}
pub trait Densor {
fn densor_id(&self) -> &str;
fn densor_kind(&self) -> DensorKind;
fn evidence_hash(&self) -> [u8; 32];
fn verify(&self) -> Result<(), DensorError>;
}