pub trait OwnedToVariant {
    fn owned_to_variant(self) -> Variant;
}
Expand description

Types that can only be safely converted to a Variant as owned values. Such types cannot implement ToVariant in general, but can still be passed to API methods as arguments, or used as return values. Notably, this includes Unique arrays, dictionaries, and references to Godot objects and instances.

This has a blanket implementation for all types that have ToVariant. As such, users should only derive or implement OwnedToVariant when ToVariant is not applicable.

This trait is used for return types of exported methods.

Deriving OwnedToVariant

The derive macro behaves the same as ToVariant. See the documentation for the latter for a detailed explanation.

Required Methods

Implementors