[−][src]Struct gdnative::gdnative_common::Variant
A Variant
can represent many of godot's core types.
The underlying data can be either stored inline or reference-counted, dependning on the size of the type and whether the it is trivially copyable.
Methods
impl Variant
[src]
impl Variant
pub fn from_vector2(val: &TypedVector2D<f32, UnknownUnit>) -> Variant | [src] |
Creates a Variant
wrapping a Vector2
.
pub fn from_vector3(val: &TypedVector3D<f32, UnknownUnit>) -> Variant | [src] |
Creates a Variant
wrapping a Vector3
.
pub fn from_quat( | [src] |
Creates a Variant
wrapping a Quat
.
pub fn from_plane(val: &Plane) -> Variant | [src] |
Creates a Variant
wrapping a Plane
.
pub fn from_rect2(val: &TypedRect<f32, UnknownUnit>) -> Variant | [src] |
Creates a Variant
wrapping a Rect2
.
pub fn from_transform(val: &Transform) -> Variant | [src] |
Creates a Variant
wrapping a Transform
.
pub fn from_transform2d( | [src] |
Creates a Variant
wrapping a Transform2D
.
pub fn from_basis(val: &Basis) -> Variant | [src] |
Creates a Variant
wrapping a Basis
.
pub fn from_color(val: &Color) -> Variant | [src] |
Creates a Variant
wrapping a Color
.
pub fn from_aabb(val: &Aabb) -> Variant | [src] |
Creates a Variant
wrapping an Aabb
.
pub fn from_rid(val: &Rid) -> Variant | [src] |
Creates a Variant
wrapping an Rid
.
pub fn from_node_path(val: &NodePath) -> Variant | [src] |
Creates a Variant
wrapping a NodePath
.
pub fn from_godot_string(val: &GodotString) -> Variant | [src] |
Creates a Variant
wrapping a GodotString
.
pub fn from_array(val: &VariantArray) -> Variant | [src] |
Creates an Variant
wrapping an array of variants.
pub fn from_byte_array(val: &ByteArray) -> Variant | [src] |
Creates a Variant
wrapping a byte array.
pub fn from_int32_array(val: &Int32Array) -> Variant | [src] |
Creates a Variant
wrapping an array of 32bit signed integers.
pub fn from_float32_array(val: &Float32Array) -> Variant | [src] |
Creates a Variant
wrapping an array of 32bit floats.
pub fn from_string_array(val: &StringArray) -> Variant | [src] |
Creates a Variant
wrapping an array of godot strings.
pub fn from_vector2_array(val: &Vector2Array) -> Variant | [src] |
Creates a Variant
wrapping an array of 2d vectors.
pub fn from_vector3_array(val: &Vector3Array) -> Variant | [src] |
Creates a Variant
wrapping an array of 3d vectors.
pub fn from_color_array(val: &ColorArray) -> Variant | [src] |
Creates a Variant
wrapping an array of colors.
pub fn from_dictionary(val: &Dictionary) -> Variant | [src] |
Creates a Variant
wrapping a dictionary.
pub fn new() -> Variant | [src] |
Creates an empty Variant
.
pub fn from_str<S>(s: S) -> Variant where | [src] |
Creates a Variant
wrapping a string.
pub fn from_object<T>(val: &T) -> Variant where | [src] |
Creates a Variant
wrapping a Godot object.
pub fn from_i64(v: i64) -> Variant | [src] |
Creates a Variant
wrapping a signed integer value.
pub fn from_u64(v: u64) -> Variant | [src] |
Creates a Variant
wrapping an unsigned integer value.
pub fn from_bool(v: bool) -> Variant | [src] |
Creates a Variant
wrapping an boolean.
pub fn to_vector2(&self) -> TypedVector2D<f32, UnknownUnit> | [src] |
Do a best effort to create a Vector2
out of the variant, possibly returning a default value.
pub fn try_to_vector2(&self) -> Option<TypedVector2D<f32, UnknownUnit>> | [src] |
Returns Some(Vector2)
if this variant is one, None
otherwise.
pub fn to_vector3(&self) -> TypedVector3D<f32, UnknownUnit> | [src] |
Do a best effort to create a Vector3
out of the variant, possibly returning a default value.
pub fn try_to_vector3(&self) -> Option<TypedVector3D<f32, UnknownUnit>> | [src] |
Returns Some(Vector3)
if this variant is one, None
otherwise.
pub fn to_quat(&self) -> TypedRotation3D<f32, UnknownUnit, UnknownUnit> | [src] |
Do a best effort to create a Quat
out of the variant, possibly returning a default value.
pub fn try_to_quat( | [src] |
Returns Some(Quat)
if this variant is one, None
otherwise.
pub fn to_plane(&self) -> Plane | [src] |
Do a best effort to create a Plane
out of the variant, possibly returning a default value.
pub fn try_to_plane(&self) -> Option<Plane> | [src] |
Returns Some(Plane)
if this variant is one, None
otherwise.
pub fn to_rect2(&self) -> TypedRect<f32, UnknownUnit> | [src] |
Do a best effort to create a Rect2
out of the variant, possibly returning a default value.
pub fn try_to_rect2(&self) -> Option<TypedRect<f32, UnknownUnit>> | [src] |
Returns Some(Rect2)
if this variant is one, None
otherwise.
pub fn to_transform(&self) -> Transform | [src] |
Do a best effort to create a Transform
out of the variant, possibly returning a default value.
pub fn try_to_transform(&self) -> Option<Transform> | [src] |
Returns Some(Transform)
if this variant is one, None
otherwise.
pub fn to_transform2d(&self) -> TypedTransform2D<f32, UnknownUnit, UnknownUnit> | [src] |
Do a best effort to create a Transform2D
out of the variant, possibly returning a default value.
pub fn try_to_transform2d( | [src] |
Returns Some(Transform2D)
if this variant is one, None
otherwise.
pub fn to_basis(&self) -> Basis | [src] |
Do a best effort to create a Basis
out of the variant, possibly returning a default value.
pub fn try_to_basis(&self) -> Option<Basis> | [src] |
Returns Some(Basis)
if this variant is one, None
otherwise.
pub fn to_color(&self) -> Color | [src] |
Do a best effort to create a Color
out of the variant, possibly returning a default value.
pub fn try_to_color(&self) -> Option<Color> | [src] |
Returns Some(Color)
if this variant is one, None
otherwise.
pub fn to_aabb(&self) -> Aabb | [src] |
Do a best effort to create an Aabb
out of the variant, possibly returning a default value.
pub fn try_to_aabb(&self) -> Option<Aabb> | [src] |
Returns Some(Aabb)
if this variant is one, None
otherwise.
pub fn to_f64(&self) -> f64 | [src] |
Do a best effort to create a f64
out of the variant, possibly returning a default value.
pub fn try_to_f64(&self) -> Option<f64> | [src] |
Returns Some(f64)
if this variant is one, None
otherwise.
pub fn to_i64(&self) -> i64 | [src] |
Do a best effort to create an i64
out of the variant, possibly returning a default value.
pub fn try_to_i64(&self) -> Option<i64> | [src] |
Returns Some(i64)
if this variant is one, None
otherwise.
pub fn to_bool(&self) -> bool | [src] |
Do a best effort to create a bool
out of the variant, possibly returning a default value.
pub fn try_to_bool(&self) -> Option<bool> | [src] |
Returns Some(bool)
if this variant is one, None
otherwise.
pub fn to_node_path(&self) -> NodePath | [src] |
Do a best effort to create a NodePath
out of the variant, possibly returning a default value.
pub fn try_to_node_path(&self) -> Option<NodePath> | [src] |
Returns Some(NodePath)
if this variant is one, None
otherwise.
pub fn to_godot_string(&self) -> GodotString | [src] |
Do a best effort to create a GodotString
out of the variant, possibly returning a default value.
pub fn try_to_godot_string(&self) -> Option<GodotString> | [src] |
Returns Some(GodotString)
if this variant is one, None
otherwise.
pub fn to_rid(&self) -> Rid | [src] |
Do a best effort to create a Rid
out of the variant, possibly returning a default value.
pub fn try_to_rid(&self) -> Option<Rid> | [src] |
Returns Some(Rid)
if this variant is one, None
otherwise.
pub fn to_array(&self) -> VariantArray | [src] |
Do a best effort to create a VariantArray
out of the variant, possibly returning a default value.
pub fn try_to_array(&self) -> Option<VariantArray> | [src] |
Returns Some(VariantArray)
if this variant is one, None
otherwise.
pub fn to_byte_array(&self) -> ByteArray | [src] |
Do a best effort to create a ByteArray
out of the variant, possibly returning a default value.
pub fn try_to_byte_array(&self) -> Option<ByteArray> | [src] |
Returns Some(ByteArray)
if this variant is one, None
otherwise.
pub fn to_int32_array(&self) -> Int32Array | [src] |
Do a best effort to create an Int32Array
out of the variant, possibly returning a default value.
pub fn try_to_int32_array(&self) -> Option<Int32Array> | [src] |
Returns Some(Int32Array)
if this variant is one, None
otherwise.
pub fn to_float32_array(&self) -> Float32Array | [src] |
Do a best effort to create a Float32Array
out of the variant, possibly returning a default value.
pub fn try_to_float32_array(&self) -> Option<Float32Array> | [src] |
Returns Some(Float32Array)
if this variant is one, None
otherwise.
pub fn to_string_array(&self) -> StringArray | [src] |
Do a best effort to create a StringArray
out of the variant, possibly returning a default value.
pub fn try_to_string_array(&self) -> Option<StringArray> | [src] |
Returns Some(StringArray)
if this variant is one, None
otherwise.
pub fn to_vector2_array(&self) -> Vector2Array | [src] |
Do a best effort to create a Vector2Array
out of the variant, possibly returning a default value.
pub fn try_to_vector2_array(&self) -> Option<Vector2Array> | [src] |
Returns Some(Vector2Array)
if this variant is one, None
otherwise.
pub fn to_vector3_array(&self) -> Vector3Array | [src] |
Do a best effort to create a Vector3Array
out of the variant, possibly returning a default value.
pub fn try_to_vector3_array(&self) -> Option<Vector3Array> | [src] |
Returns Some(Vector3Array)
if this variant is one, None
otherwise.
pub fn to_color_array(&self) -> ColorArray | [src] |
Do a best effort to create a ColorArray
out of the variant, possibly returning a default value.
pub fn try_to_color_array(&self) -> Option<ColorArray> | [src] |
Returns Some(ColorArray)
if this variant is one, None
otherwise.
pub fn to_dictionary(&self) -> Dictionary | [src] |
Do a best effort to create a Dictionary
out of the variant, possibly returning a default value.
pub fn try_to_dictionary(&self) -> Option<Dictionary> | [src] |
Returns Some(Dictionary)
if this variant is one, None
otherwise.
pub fn try_to_object<T>(&self) -> Option<T> where | [src] |
pub fn to_string(&self) -> String | [src] |
pub fn try_to_string(&self) -> Option<String> | [src] |
pub fn get_type(&self) -> VariantType | [src] |
Returns this variant's type.
pub fn is_nil(&self) -> bool | [src] |
Returns true if this is an empty variant.
pub fn has_method(&self, method: &GodotString) -> bool | [src] |
pub fn call(&mut self, method: &GodotString, args: &[Variant]) -> Result<(), ()> | [src] |
pub fn forget(self) -> godot_variant | [src] |
Returns the internal ffi representation of the variant and consumes the rust object without running the destructor.
This should be only used when certain that the receiving side is responsible for running the destructor for the object, otherwise it is leaked.
Trait Implementations
impl Clone for Variant
[src]
impl Clone for Variant
fn clone(&self) -> Variant | [src] |
fn clone_from(&mut self, source: &Self) | 1.0.0 [src] |
Performs copy-assignment from source
. Read more
impl<'l> From<&'l Plane> for Variant
[src]
impl<'l> From<&'l Plane> for Variant
impl<'l> From<&'l VariantArray> for Variant
[src]
impl<'l> From<&'l VariantArray> for Variant
fn from(val: &'l VariantArray) -> Variant | [src] |
impl<'l> From<&'l TypedRotation3D<f32, UnknownUnit, UnknownUnit>> for Variant
[src]
impl<'l> From<&'l TypedRotation3D<f32, UnknownUnit, UnknownUnit>> for Variant
fn from(val: &'l TypedRotation3D<f32, UnknownUnit, UnknownUnit>) -> Variant | [src] |
impl<'l> From<&'l Float32Array> for Variant
[src]
impl<'l> From<&'l Float32Array> for Variant
fn from(val: &'l Float32Array) -> Variant | [src] |
impl<T> From<T> for Variant where
T: GodotObject,
[src]
impl<T> From<T> for Variant where
T: GodotObject,
impl<'l> From<&'l TypedVector2D<f32, UnknownUnit>> for Variant
[src]
impl<'l> From<&'l TypedVector2D<f32, UnknownUnit>> for Variant
fn from(val: &'l TypedVector2D<f32, UnknownUnit>) -> Variant | [src] |
impl<'l> From<&'l str> for Variant
[src]
impl<'l> From<&'l str> for Variant
impl<'l> From<&'l Vector3Array> for Variant
[src]
impl<'l> From<&'l Vector3Array> for Variant
fn from(val: &'l Vector3Array) -> Variant | [src] |
impl From<i64> for Variant
[src]
impl From<i64> for Variant
impl<'l> From<&'l Aabb> for Variant
[src]
impl<'l> From<&'l Aabb> for Variant
impl<'l> From<&'l Int32Array> for Variant
[src]
impl<'l> From<&'l Int32Array> for Variant
fn from(val: &'l Int32Array) -> Variant | [src] |
impl<'l> From<&'l TypedRect<f32, UnknownUnit>> for Variant
[src]
impl<'l> From<&'l TypedRect<f32, UnknownUnit>> for Variant
impl From<u64> for Variant
[src]
impl From<u64> for Variant
impl<'l> From<&'l Color> for Variant
[src]
impl<'l> From<&'l Color> for Variant
impl<'l> From<&'l ByteArray> for Variant
[src]
impl<'l> From<&'l ByteArray> for Variant
impl<'l> From<&'l Basis> for Variant
[src]
impl<'l> From<&'l Basis> for Variant
impl<'l> From<&'l Transform> for Variant
[src]
impl<'l> From<&'l Transform> for Variant
impl<'l> From<&'l Rid> for Variant
[src]
impl<'l> From<&'l Rid> for Variant
impl<'l> From<&'l ColorArray> for Variant
[src]
impl<'l> From<&'l ColorArray> for Variant
fn from(val: &'l ColorArray) -> Variant | [src] |
impl<'l> From<&'l Dictionary> for Variant
[src]
impl<'l> From<&'l Dictionary> for Variant
fn from(val: &'l Dictionary) -> Variant | [src] |
impl From<bool> for Variant
[src]
impl From<bool> for Variant
impl<'l> From<&'l NodePath> for Variant
[src]
impl<'l> From<&'l NodePath> for Variant
impl<'l> From<&'l TypedVector3D<f32, UnknownUnit>> for Variant
[src]
impl<'l> From<&'l TypedVector3D<f32, UnknownUnit>> for Variant
fn from(val: &'l TypedVector3D<f32, UnknownUnit>) -> Variant | [src] |
impl<'l> From<&'l TypedTransform2D<f32, UnknownUnit, UnknownUnit>> for Variant
[src]
impl<'l> From<&'l TypedTransform2D<f32, UnknownUnit, UnknownUnit>> for Variant
fn from(val: &'l TypedTransform2D<f32, UnknownUnit, UnknownUnit>) -> Variant | [src] |
impl<'l> From<&'l GodotString> for Variant
[src]
impl<'l> From<&'l GodotString> for Variant
fn from(val: &'l GodotString) -> Variant | [src] |
impl<'l> From<&'l Vector2Array> for Variant
[src]
impl<'l> From<&'l Vector2Array> for Variant
fn from(val: &'l Vector2Array) -> Variant | [src] |
impl<'l> From<&'l String> for Variant
[src]
impl<'l> From<&'l String> for Variant
impl Debug for Variant
[src]
impl Debug for Variant
impl Drop for Variant
[src]
impl Drop for Variant
impl Default for Variant
[src]
impl Default for Variant
impl PartialEq<Variant> for Variant
[src]
impl PartialEq<Variant> for Variant
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |