rscel/types/cel_value_dyn.rs
1use std::{any::Any, fmt};
2
3use crate::CelValue;
4
5// unsure how much i want to support with this...
6// im thinking I allow object like things only for the first iteration and
7// slowly move towards the whole CelValue's set of operations
8pub trait CelValueDyn: fmt::Debug + fmt::Display + Send + Sync {
9 fn as_type(&self) -> CelValue;
10 fn access(&self, key: &str) -> CelValue;
11 fn eq(&self, rhs: &CelValue) -> CelValue;
12 fn is_truthy(&self) -> bool;
13 fn any_ref<'a>(&'a self) -> &'a dyn Any;
14}