pub trait Var: GodotConvert {
// Required methods
fn get_property(&self) -> Self::Via;
fn set_property(&mut self, value: Self::Via);
// Provided method
fn property_hint() -> PropertyHintInfo { ... }
}
Expand description
Trait implemented for types that can be used as #[var]
fields.
This creates a copy of the value, according to copy semantics provided by Clone
. For example, Array
, Dictionary
and Gd
are
returned by shared reference instead of copying the actual data.
This does not require FromGodot
or ToGodot
, so that something can be used as a property even if it can’t be used in function
arguments/return types.
Required Methods§
fn get_property(&self) -> Self::Via
fn set_property(&mut self, value: Self::Via)
Provided Methods§
fn property_hint() -> PropertyHintInfo
Object Safety§
This trait is not object safe.