pub trait AsValue<'rt> {
// Required method
fn as_value(&self, rt: &mut RuntimeHandle<'rt>) -> JsiValue<'rt>;
}
Expand description
Conversion trait to and from JsiValue
. This is needed instead of the
normal Into
trait b/c creating a JsiValue requires a RuntimeHandle
.
Note that using this trait will create a copy of the data being converted
(ex.: using as_value()
on a JsiObject
will create a value that
contains a copy of that object).