pub trait FromScript {
type This<'w>;
// Required method
fn from_script(
value: ScriptValue,
world: WorldGuard<'_>,
) -> Result<Self::This<'_>, InteropError>
where Self: Sized;
}Expand description
Describes the procedure for constructing a value of type T from a ScriptValue.
The FromScript::This associated type is used to allow for the implementation of this trait to return
a type with the lifetime of the world guard. In 99% cases you can just use Self as the associated type.
Required Associated Types§
Required Methods§
Sourcefn from_script(
value: ScriptValue,
world: WorldGuard<'_>,
) -> Result<Self::This<'_>, InteropError>where
Self: Sized,
fn from_script(
value: ScriptValue,
world: WorldGuard<'_>,
) -> Result<Self::This<'_>, InteropError>where
Self: Sized,
Construct a value of type T from a ScriptValue.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".