pub trait ObjectToOwned<T: GodotClass> {
// Required method
fn object_to_owned(&self) -> Gd<T>;
}Expand description
Obtain owned Gd from either &self or &Gd.
This trait allows passing either Gd<T> or C (where C: WithBaseField) to functions that need an owned Gd<T>.
This is primarily used for signal connection methods in TypedSignal and
ConnectBuilder, where you can pass either a &Gd (outside) or &SomeClass
(from within impl block) as the receiver object.
§Similar traits
UniformObjectDerefprovides unified dereferencing of user and engine classes.AsArgenables general argument conversions for Godot APIs.
Required Methods§
Sourcefn object_to_owned(&self) -> Gd<T>
fn object_to_owned(&self) -> Gd<T>
Converts the object reference to an owned Gd<T>.