Trait Object
hatter
pub trait Object { fn typename(&self) -> &str; fn get(&self, key: &str) -> Option<Value> { ... } fn set(&self, key: &str, val: Value) { ... } }
If you want to expose your own structs to Hatter code, this is the trait for you.
fn typename(&self) -> &str
String name of this type, like "string" or "Person".
fn get(&self, key: &str) -> Option<Value>
obj.KEY
fn set(&self, key: &str, val: Value)
obj.KEY = VAL