Skip to main content

ObjectMethods

Trait ObjectMethods 

Source
pub trait ObjectMethods {
    // Required methods
    fn object_call(
        var: &pxs_Var,
        method: &str,
        args: &mut pxs_VarList,
    ) -> Result<pxs_Var, Error>;
    fn call_method(
        method: &str,
        args: &mut pxs_VarList,
    ) -> Result<pxs_Var, Error>;
    fn var_call(
        method: &pxs_Var,
        args: &mut pxs_VarList,
    ) -> Result<pxs_Var, Error>;
    fn get(var: &pxs_Var, key: &str) -> Result<pxs_Var, Error>;
    fn set(var: &pxs_Var, key: &str, value: &pxs_Var) -> Result<pxs_Var, Error>;
}
Expand description

Methods for interacting with objects and callbacks from the runtime.

Required Methods§

Source

fn object_call( var: &pxs_Var, method: &str, args: &mut pxs_VarList, ) -> Result<pxs_Var, Error>

Call a method on a object.

Source

fn call_method(method: &str, args: &mut pxs_VarList) -> Result<pxs_Var, Error>

Call a method and pass in args

Source

fn var_call(method: &pxs_Var, args: &mut pxs_VarList) -> Result<pxs_Var, Error>

Call a pxs_Var function.

Source

fn get(var: &pxs_Var, key: &str) -> Result<pxs_Var, Error>

Getter

Source

fn set(var: &pxs_Var, key: &str, value: &pxs_Var) -> Result<pxs_Var, Error>

Setter

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§