UserObject

Trait UserObject 

Source
pub trait UserObject {
    // Required method
    fn typ(&self) -> &'static str;

    // Provided methods
    fn get(&self, key: &str) -> Option<Value> { ... }
    fn set(&mut self, key: &str, value: Value) -> Result<(), UserObjectError> { ... }
    fn call(&self, key: &str, args: Vec<Value>) -> Result<Value, Box<dyn Error>> { ... }
    fn call_mut(
        &mut self,
        key: &str,
        args: Vec<Value>,
    ) -> Result<Value, Box<dyn Error>> { ... }
}

Required Methods§

Source

fn typ(&self) -> &'static str

Provided Methods§

Source

fn get(&self, key: &str) -> Option<Value>

Source

fn set(&mut self, key: &str, value: Value) -> Result<(), UserObjectError>

Source

fn call(&self, key: &str, args: Vec<Value>) -> Result<Value, Box<dyn Error>>

Source

fn call_mut( &mut self, key: &str, args: Vec<Value>, ) -> Result<Value, Box<dyn Error>>

Implementors§