GodotVariant

Trait GodotVariant 

Source
pub trait GodotVariant:
    Debug
    + Send
    + Sync {
    // Required methods
    fn byte_length(&self) -> usize;
    fn as_any(&self) -> &dyn Any;
    fn variant_eq(&self, other: &dyn GodotVariant) -> bool;
    fn bytes(&self) -> Vec<u8> ;
}
Expand description

Describes a godot variant

Required Methods§

Source

fn byte_length(&self) -> usize

Describes the byte length of a variant, most primitive variants have a static byte length. However some variants like a dictionary may have dynamic sizes

Source

fn as_any(&self) -> &dyn Any

Allows us to downcast ref a variant for use

Source

fn variant_eq(&self, other: &dyn GodotVariant) -> bool

Checks if a variant is equal to another variant

Source

fn bytes(&self) -> Vec<u8>

The variant as a byte vector

Trait Implementations§

Source§

impl AsVariant for dyn GodotVariant + '_

Source§

fn as_var<T>(&self) -> Option<&T>
where T: GodotVariant + Send + Sync + 'static,

Source§

impl Hash for Box<dyn GodotVariant>

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for dyn GodotVariant

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for dyn GodotVariant

Implementors§