Trait gdnative::core_types::ToVariantEq[][src]

pub trait ToVariantEq: Eq { }

Trait for types whose ToVariant implementations preserve equivalence.

This means that for all values a and b, a == b is equivalent to a.to_variant() == b.to_variant(). Most of the time, this means that to_variant must return a "value" type, such as a primitive i32, a GodotString, or a TypedArray.

This is mostly useful as a bound for Dictionary keys, where the difference between Rust's structural equality and Godot's referential equality semantics can lead to surprising behaviors.

This property cannot be checked by the compiler, so ToVariantEq has no extra methods.

Implementing ToVariantEq

The ToVariantEq trait is not derivable, because most derived implementations of ToVariant don't satisfy the requirements. If you are sure that your type satisfies the trait, specify that your type implements it with an empty impl:

#[derive(Eq, PartialEq, ToVariant)]
struct MyTypedInt(i32);

impl ToVariantEq for MyTypedInt {}

Implementations on Foreign Types

impl ToVariantEq for usize[src]

impl<T> ToVariantEq for Option<T> where
    T: ToVariantEq
[src]

impl ToVariantEq for String[src]

impl<'a, T> ToVariantEq for &'a mut T where
    T: ToVariantEq + ?Sized
[src]

impl ToVariantEq for i32[src]

impl ToVariantEq for u16[src]

impl ToVariantEq for u8[src]

impl<'a, T> ToVariantEq for &'a T where
    T: ToVariantEq + ?Sized
[src]

impl ToVariantEq for ()[src]

impl ToVariantEq for isize[src]

impl ToVariantEq for i16[src]

impl ToVariantEq for i8[src]

impl<T> ToVariantEq for PhantomData<T>[src]

impl ToVariantEq for u64[src]

impl ToVariantEq for u32[src]

impl ToVariantEq for str[src]

impl ToVariantEq for bool[src]

impl ToVariantEq for i64[src]

Loading content...

Implementors

impl ToVariantEq for GodotString[src]

impl ToVariantEq for NodePath[src]

impl ToVariantEq for Rid[src]

impl ToVariantEq for Variant[src]

impl<T> ToVariantEq for TypedArray<T> where
    T: Element + Eq
[src]

Loading content...