Skip to main content

dejavu/reduce/
classify.rs

1//! The reduction state machine (spec ยง12). This is the single definition of
2//! `Classification`, consumed by the reducer and stored as a string.
3
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5pub enum Classification {
6    FirstSeen,
7    Unchanged,
8    SmallDelta,
9    LargeDelta,
10}
11
12impl Classification {
13    pub fn as_str(&self) -> &'static str {
14        match self {
15            Classification::FirstSeen => "first_seen",
16            Classification::Unchanged => "unchanged",
17            Classification::SmallDelta => "small_delta",
18            Classification::LargeDelta => "large_delta",
19        }
20    }
21}