godot::meta

Trait ApiParam

pub trait ApiParam: GodotType {
    // Required method
    fn owned_to_arg<'v>(self) -> Self::Arg<'v>;
}
Expand description

Implemented for all parameter types T that are allowed to receive impl AsArg<T>.

Required Methods§

fn owned_to_arg<'v>(self) -> Self::Arg<'v>

Converts an owned value to the canonical argument type, which can be passed to impl AsArg<T>.

Useful in generic contexts where only a value is available, and one doesn’t want to dispatch between value/reference.

You should not rely on the exact return type, as it may change in future versions; treat it like impl AsArg<Self>.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl ApiParam for bool

§

fn owned_to_arg<'v>(self) -> <bool as ApiParam>::Arg<'v>

§

impl ApiParam for f32

§

fn owned_to_arg<'v>(self) -> <f32 as ApiParam>::Arg<'v>

§

impl ApiParam for f64

§

fn owned_to_arg<'v>(self) -> <f64 as ApiParam>::Arg<'v>

§

impl ApiParam for i8

§

fn owned_to_arg<'v>(self) -> <i8 as ApiParam>::Arg<'v>

§

impl ApiParam for i16

§

fn owned_to_arg<'v>(self) -> <i16 as ApiParam>::Arg<'v>

§

impl ApiParam for i32

§

fn owned_to_arg<'v>(self) -> <i32 as ApiParam>::Arg<'v>

§

impl ApiParam for i64

§

fn owned_to_arg<'v>(self) -> <i64 as ApiParam>::Arg<'v>

§

impl ApiParam for u8

§

fn owned_to_arg<'v>(self) -> <u8 as ApiParam>::Arg<'v>

§

impl ApiParam for u16

§

fn owned_to_arg<'v>(self) -> <u16 as ApiParam>::Arg<'v>

§

impl ApiParam for u32

§

fn owned_to_arg<'v>(self) -> <u32 as ApiParam>::Arg<'v>

§

impl<T> ApiParam for Option<Gd<T>>
where T: GodotClass,

§

fn owned_to_arg<'v>(self) -> <Option<Gd<T>> as ApiParam>::Arg<'v>

Implementors§