1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
use crate::value::Value;
use nanoid::nanoid;
use crate::types::*;
impl Value {
pub fn list() -> Self {
Self {
id: nanoid!(),
dt: LIST,
q: 100.0,
data: Val::List(Vec::new()),
attr: Vec::new(),
curr: -1,
}
}
pub fn from_list(value: Vec<Value>) -> Self {
Self {
id: nanoid!(),
dt: LIST,
q: 100.0,
data: Val::List(value),
attr: Vec::new(),
curr: -1,
}
}
}