pub trait ScriptType: Sized {
// Required methods
fn script_ty() -> ScriptTy;
fn from_script_value(value: &ScriptValue) -> Self;
fn into_script_value(self) -> ScriptValue;
}Expand description
A Rust type ScriptFn::from_fn can carry across the script boundary.
Implemented for the scalars every host shares (i64, f64, bool,
String), for (), and recursively for Vec<T> and
HashMap<String, T>. The conversion into Rust is the same coercion the
ScriptFnCx accessors apply, so an integer arrives where a float is
declared and a missing argument reads as the type’s empty value.
Required Methods§
Sourcefn from_script_value(value: &ScriptValue) -> Self
fn from_script_value(value: &ScriptValue) -> Self
Read one argument.
Sourcefn into_script_value(self) -> ScriptValue
fn into_script_value(self) -> ScriptValue
Hand one value back to the script.
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.