Skip to main content

JsStateConvert

Trait JsStateConvert 

Source
pub trait JsStateConvert: Sized {
    // Required methods
    fn to_js_value(&self) -> JsValue;
    fn from_js_value(val: JsValue) -> Result<Self, String>;
}
Expand description

Trait for converting between Rust states and their JavaScript wrappers.

Required Methods§

Source

fn to_js_value(&self) -> JsValue

Convert the Rust state to a JavaScript wrapper object.

Source

fn from_js_value(val: JsValue) -> Result<Self, String>

Convert a JavaScript wrapper object back to the Rust state.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl JsStateConvert for CompoundState

Source§

impl JsStateConvert for RealVectorState

Source§

impl JsStateConvert for SE2State

Source§

impl JsStateConvert for SE3State

Source§

impl JsStateConvert for SO2State

Source§

impl JsStateConvert for SO3State

Implementors§