Skip to main content

AsVArg

Trait AsVArg 

pub trait AsVArg<T>: Sized
where T: ToGodot,
{ }
Expand description

Implicit conversions for arguments passed to collection APIs (e.g. Dictionary, Array).

AsVArg<T> is a superset of AsArg<T>: all types accepted by AsArg<T> are also accepted by AsVArg<T>.

Additionally, AsVArg<Variant> is implemented for most types that have a ToGodot implementation. This enables implicit conversion to Variant when passing to collection APIs, e.g. dict.set("key", 42) for Dictionary<Variant, Variant>.

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.

Implementors§

§

impl<Arg, T> AsVArg<T> for Arg
where T: ToGodot, Arg: DisjointVArg<<T as ToGodot>::Pass, T>,