Trait gdnative_core::core_types::variant::FromVariant[][src]

pub trait FromVariant: Sized {
    fn from_variant(variant: &Variant) -> Result<Self, FromVariantError>;
}

Types that can be converted from a Variant.

Option<T> and MaybeNot<T>

Option<T> requires the Variant to be T or Nil, in that order. For looser semantics, use MaybeNot<T>, which will catch all variant values that are not T as well.

Vec<T>

The FromVariant implementation for Vec<T> only allow homogeneous arrays. If you want to manually handle potentially heterogeneous values e.g. for error reporting, use VariantArray directly or compose with an appropriate wrapper: Vec<Option<T>> or Vec<MaybeNot<T>>.

Deriving FromVariant

The derive macro provides implementation consistent with derived ToVariant. See ToVariant for detailed documentation.

Required methods

Loading content...

Implementations on Foreign Types

impl FromVariant for ()[src]

impl FromVariant for f64[src]

impl FromVariant for i64[src]

impl FromVariant for u64[src]

impl FromVariant for bool[src]

impl FromVariant for i8[src]

impl FromVariant for i16[src]

impl FromVariant for i32[src]

impl FromVariant for isize[src]

impl FromVariant for u8[src]

impl FromVariant for u16[src]

impl FromVariant for u32[src]

impl FromVariant for usize[src]

impl FromVariant for f32[src]

impl FromVariant for String[src]

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

impl<T: FromVariant> FromVariant for Option<T>[src]

impl<T: FromVariant, E: FromVariant> FromVariant for Result<T, E>[src]

impl<T: FromVariant> FromVariant for Vec<T>[src]

impl<T1: FromVariant, T2: FromVariant, T3: FromVariant, T4: FromVariant, T5: FromVariant, T6: FromVariant, T7: FromVariant, T8: FromVariant, T9: FromVariant, T10: FromVariant, T11: FromVariant, T12: FromVariant> FromVariant for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)[src]

impl<T2: FromVariant, T3: FromVariant, T4: FromVariant, T5: FromVariant, T6: FromVariant, T7: FromVariant, T8: FromVariant, T9: FromVariant, T10: FromVariant, T11: FromVariant, T12: FromVariant> FromVariant for (T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)[src]

impl<T3: FromVariant, T4: FromVariant, T5: FromVariant, T6: FromVariant, T7: FromVariant, T8: FromVariant, T9: FromVariant, T10: FromVariant, T11: FromVariant, T12: FromVariant> FromVariant for (T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)[src]

impl<T4: FromVariant, T5: FromVariant, T6: FromVariant, T7: FromVariant, T8: FromVariant, T9: FromVariant, T10: FromVariant, T11: FromVariant, T12: FromVariant> FromVariant for (T4, T5, T6, T7, T8, T9, T10, T11, T12)[src]

impl<T5: FromVariant, T6: FromVariant, T7: FromVariant, T8: FromVariant, T9: FromVariant, T10: FromVariant, T11: FromVariant, T12: FromVariant> FromVariant for (T5, T6, T7, T8, T9, T10, T11, T12)[src]

impl<T6: FromVariant, T7: FromVariant, T8: FromVariant, T9: FromVariant, T10: FromVariant, T11: FromVariant, T12: FromVariant> FromVariant for (T6, T7, T8, T9, T10, T11, T12)[src]

impl<T7: FromVariant, T8: FromVariant, T9: FromVariant, T10: FromVariant, T11: FromVariant, T12: FromVariant> FromVariant for (T7, T8, T9, T10, T11, T12)[src]

impl<T8: FromVariant, T9: FromVariant, T10: FromVariant, T11: FromVariant, T12: FromVariant> FromVariant for (T8, T9, T10, T11, T12)[src]

impl<T9: FromVariant, T10: FromVariant, T11: FromVariant, T12: FromVariant> FromVariant for (T9, T10, T11, T12)[src]

impl<T10: FromVariant, T11: FromVariant, T12: FromVariant> FromVariant for (T10, T11, T12)[src]

impl<T11: FromVariant, T12: FromVariant> FromVariant for (T11, T12)[src]

impl<T12: FromVariant> FromVariant for (T12,)[src]

Loading content...

Implementors

impl FromVariant for Color[src]

impl FromVariant for Dictionary<Shared>[src]

impl FromVariant for Aabb[src]

impl FromVariant for Basis[src]

impl FromVariant for Plane[src]

impl FromVariant for Transform[src]

impl FromVariant for NodePath[src]

impl FromVariant for Rid[src]

impl FromVariant for GodotString[src]

impl FromVariant for Variant[src]

impl FromVariant for VariantArray<Shared>[src]

impl FromVariant for Quat[src]

impl FromVariant for Rect2[src]

impl FromVariant for Transform2D[src]

impl FromVariant for Vector2[src]

impl FromVariant for Vector3[src]

impl<T> FromVariant for Instance<T, Shared> where
    T: NativeClass,
    T::Base: GodotObject<RefKind = RefCounted>, 
[src]

impl<T: Element> FromVariant for TypedArray<T>[src]

impl<T: FromVariant> FromVariant for MaybeNot<T>[src]

impl<T: GodotObject> FromVariant for Ref<T, Shared>[src]

Loading content...