FromDynamic

Trait FromDynamic 

Source
pub trait FromDynamic
where Self: Sized,
{ // Required method fn from_dynamic( ctx: &NativeCallContext<'_>, v: Dynamic, default: Option<&Self>, ) -> Result<Self, Box<EvalAltResult>>; }
Expand description

Helper trait to go from a Rhai dynamic object to a particular type

Required Methods§

Source

fn from_dynamic( ctx: &NativeCallContext<'_>, v: Dynamic, default: Option<&Self>, ) -> Result<Self, Box<EvalAltResult>>

Build an object from a dynamic value and optional default

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.

Implementations on Foreign Types§

Source§

impl FromDynamic for f64

Source§

fn from_dynamic( ctx: &NativeCallContext<'_>, d: Dynamic, _default: Option<&f64>, ) -> Result<Self, Box<EvalAltResult>>

Source§

impl FromDynamic for Vec<Tree>

Source§

fn from_dynamic( ctx: &NativeCallContext<'_>, d: Dynamic, _default: Option<&Vec<Tree>>, ) -> Result<Self, Box<EvalAltResult>>

Source§

impl FromDynamic for Tree

Source§

fn from_dynamic( ctx: &NativeCallContext<'_>, d: Dynamic, _default: Option<&Tree>, ) -> Result<Self, Box<EvalAltResult>>

Source§

impl FromDynamic for Axis

Source§

fn from_dynamic( ctx: &NativeCallContext<'_>, d: Dynamic, _default: Option<&Self>, ) -> Result<Self, Box<EvalAltResult>>

Source§

impl FromDynamic for Plane

Source§

fn from_dynamic( ctx: &NativeCallContext<'_>, d: Dynamic, _default: Option<&Self>, ) -> Result<Self, Box<EvalAltResult>>

Source§

impl FromDynamic for Vec2

Source§

fn from_dynamic( ctx: &NativeCallContext<'_>, d: Dynamic, _default: Option<&Vec2>, ) -> Result<Self, Box<EvalAltResult>>

Source§

impl FromDynamic for Vec3

Source§

fn from_dynamic( ctx: &NativeCallContext<'_>, d: Dynamic, default: Option<&Vec3>, ) -> Result<Self, Box<EvalAltResult>>

Source§

impl FromDynamic for Vec4

Source§

fn from_dynamic( ctx: &NativeCallContext<'_>, d: Dynamic, _default: Option<&Vec4>, ) -> Result<Self, Box<EvalAltResult>>

Implementors§