MethodRegistration

gdext.internal.register.MethodRegistration

Registers Scala methods on a registered class so they are callable from GDScript / the engine (the #[func] analogue), and provides the getter/ setter methods that property (@export) registration links together.

Dispatch goes through the Variant call_func path: the trampoline finds the instance and the method dispatcher by their tokens, then invokes the dispatcher with the raw argument Variants and the return Variant slot. A dispatcher reads its args via the Phase 1 FromVariant seam and writes its result via ToVariant. All argument/return marshalling reuses that seam, so any builtin-convertible type is supported.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

abstract class Dispatch

A registered method's runtime dispatch over raw Variant storage. The argument array and return slot arrive as Long addresses (see gdext.internal.Addr), so a call boxes nothing.

A registered method's runtime dispatch over raw Variant storage. The argument array and return slot arrive as Long addresses (see gdext.internal.Addr), so a call boxes nothing.

Attributes

Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

inline def argAt(args: Long, i: Int): Long

The address of the i-th argument Variant.

The address of the i-th argument Variant.

Attributes

inline def getterDispatch[A](inline get: GodotScriptClass => A)(using tv: ToVariant[A]): Dispatch

Getter dispatch: primitives are written straight into the return Variant (no boxing); any other type goes through its ToVariant.

Getter dispatch: primitives are written straight into the return Variant (no boxing); any other type goes through its ToVariant.

Attributes

def methodCallExport(methodUserdata: Long, instance: Long, args: Long, argCount: Long, rReturn: Long, rError: Long): Unit
def registerAction(className: String, methodName: String, action: GodotScriptClass => Unit): Unit

A no-argument, void "action" method — e.g. a signal handler bound via a gdext.builtin.Callable (Callable(object, name)). When the engine invokes it, action runs with the live Scala instance.

A no-argument, void "action" method — e.g. a signal handler bound via a gdext.builtin.Callable (Callable(object, name)). When the engine invokes it, action runs with the live Scala instance.

Attributes

def registerExportGetter[A](className: String, methodName: String, get: GodotScriptClass => A)(using et: ExportType[A]): Unit

Getter backed by an ExportType (covers object/enum/dict exports).

Getter backed by an ExportType (covers object/enum/dict exports).

Attributes

def registerExportSetter[A](className: String, methodName: String, set: (GodotScriptClass, A) => Unit)(using et: ExportType[A]): Unit

Setter backed by an ExportType.

Setter backed by an ExportType.

Attributes

inline def registerGetter[A](className: String, methodName: String, inline get: GodotScriptClass => A)(using tv: ToVariant[A], vt: VariantTypeOf[A]): Unit

A getter: () => A, exposed as a no-arg method returning A.

A getter: () => A, exposed as a no-arg method returning A.

Attributes

inline def registerSetter[A](className: String, methodName: String, inline set: (GodotScriptClass, A) => Unit)(using fv: FromVariant[A], vt: VariantTypeOf[A]): Unit

A setter: A => Unit, exposed as a 1-arg void method.

A setter: A => Unit, exposed as a 1-arg void method.

Attributes

inline def setterDispatch[A](inline set: (GodotScriptClass, A) => Unit)(using fv: FromVariant[A]): Dispatch

Setter dispatch: the counterpart of getterDispatch for argument 0.

Setter dispatch: the counterpart of getterDispatch for argument 0.

Attributes