stepflow_data/
base_value.rs

1use std::borrow::Cow;
2
3/// The base store for [`Value`](crate::value::Value). All values must support storing and retrieving data as one of these types.
4#[derive(PartialEq)]
5pub enum BaseValue {
6  String(String),
7  Boolean(bool),
8  Float(f64),
9}
10
11impl From<String> for BaseValue {
12    fn from(s: String) -> Self {
13      BaseValue::String(s)
14    }
15}
16
17impl From<Cow<'static, str>> for BaseValue {
18  fn from(s: Cow<'static, str>) -> Self {
19    BaseValue::String(s.into_owned())
20  }
21}
22
23impl From<bool> for BaseValue {
24    fn from(b: bool) -> Self {
25      BaseValue::Boolean(b)
26    }
27}
28
29impl From<f64> for BaseValue {
30    fn from(float: f64) -> Self {
31      BaseValue::Float(float)
32    }
33}