Skip to main content

ParamMetadata

Enum ParamMetadata 

#[non_exhaustive]
pub enum ParamMetadata {
Show 14 variants NONE, INT_IS_INT8, INT_IS_INT16, INT_IS_INT32, INT_IS_INT64, INT_IS_UINT8, INT_IS_UINT16, INT_IS_UINT32, INT_IS_UINT64, INT_IS_CHAR16, INT_IS_CHAR32, REAL_IS_FLOAT, REAL_IS_DOUBLE, OBJECT_IS_REQUIRED,
}
Expand description

Metadata for a method parameter or return value, describing the precise numeric type.

Used in method registration to convey extra type information beyond the basic VariantType. For example, distinguishing i8 from i64 even though both are represented as INT in Godot’s type system. While irrelevant for GDScript, this can be helpful for other languages. The FFI representation is not affected by this, underlying types are always i64, f64 or object pointers.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

NONE

No special metadata; use the default representation.

§

INT_IS_INT8

Rust i8.

§

INT_IS_INT16

Rust i16.

§

INT_IS_INT32

Rust i32.

§

INT_IS_INT64

Rust i64.

§

INT_IS_UINT8

Rust u8.

§

INT_IS_UINT16

Rust u16.

§

INT_IS_UINT32

Rust u32.

§

INT_IS_UINT64

Rust u64.

§

INT_IS_CHAR16

16-bit character (UTF-16).

§

INT_IS_CHAR32

32-bit character (UTF-32).

§

REAL_IS_FLOAT

Rust f32 single-precision float.

§

REAL_IS_DOUBLE

Rust f64 double-precision float.

§

OBJECT_IS_REQUIRED

Object that must not be null (non-nullable Gd<T> parameter).

Compatibility: Only has an effect in Godot 4.6+. In earlier versions, this behaves like NONE, effectively allowing null objects.

Implementations§

§

impl ParamMetadata

pub fn to_sys(self) -> u32

Converts to the raw GDExtension constant.

Trait Implementations§

§

impl Clone for ParamMetadata

§

fn clone(&self) -> ParamMetadata

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for ParamMetadata

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for ParamMetadata

§

fn default() -> ParamMetadata

Returns the “default value” for a type. Read more
§

impl PartialEq for ParamMetadata

§

fn eq(&self, other: &ParamMetadata) -> 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.
§

impl Copy for ParamMetadata

§

impl Eq for ParamMetadata

§

impl StructuralPartialEq for ParamMetadata

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.