variant_config/dsl/
variant_value.rs

1use super::utils::get_string_hash;
2use super::RandomState;
3
4#[derive(Debug, Clone)]
5pub enum VariantValue {
6    Int(i64),
7    Bool(bool),
8    String(String),
9}
10
11impl VariantValue {
12    pub fn to_i64(&self, random_state: &RandomState) -> i64 {
13        match self {
14            Self::Int(i) => *i,
15            Self::Bool(true) => 1,
16            Self::Bool(false) => 0,
17            Self::String(s) => get_string_hash(random_state, s),
18        }
19    }
20}