struct Lapis::DSL::StaticSignalBuilder

Overview

Declarative builder wrapping Tier 1 Lapis::Core::StaticSignalTable for compile-time typed proc binding, slot construction, and zero-allocation emission.

Defined in:

lapis/dsl/frame_arena_dsl.cr

Constructors

Instance Method Summary

Instance methods inherited from class Object

try?(&)
try?
try?

Constructor Detail

def self.new(table : Lapis::Core::StaticSignalTable = ::Lapis::Core::StaticSignalTable.global) #

Instance Method Detail

def bind(emitter_id : UInt64, signal_name : String, callback : Proc(*T, R), once : Bool = false) : UInt64 forall T, R #

Binds a compile-time typed Proc(*T, R) to (emitter_id, signal_name).


def bind(emitter : Godot::Object, signal_name : String, callback : Proc(*T, R), once : Bool = false) : UInt64 forall T, R #

Binds a compile-time typed Proc(*T, R) to (emitter, signal_name).


def bind_by_hash(emitter_id : UInt64, signal_hash : UInt64, callback : Proc(*T, R), once : Bool = false) : UInt64 forall T, R #

Binds a compile-time typed Proc(*T, R) to (emitter_id, signal_hash).


def clear_emitter(emitter_id : UInt64) : Int32 #

Clears all signal bindings for emitter_id.


def clear_emitter(emitter : Godot::Object) : Int32 #

Clears all signal bindings for emitter.


def emit(emitter_id : UInt64, signal_name : String, *args : *T) : Int32 forall T #

Emits (emitter_id, signal_name) with *args with strictly zero GC heap allocations.


def emit(emitter : Godot::Object, signal_name : String, *args : *T) : Int32 forall T #

Emits (emitter, signal_name) with *args with strictly zero GC heap allocations.


def slot(emitter_id : UInt64, signal_name : String, *types : *T) forall T #

Returns a typed StaticSignalSlot(*T) bound to (emitter_id, signal_name).


def slot(emitter : Godot::Object, signal_name : String | Symbol, *types : *T) forall T #

Returns a typed StaticSignalSlot(*T) bound to (emitter, signal_name).



def unbind(emitter_id : UInt64, signal_name : String, callback : Proc(*T, R)) : Bool forall T, R #

Unbinds a matching Proc(*T, R) from (emitter_id, signal_name).


def unbind(emitter : Godot::Object, signal_name : String, callback : Proc(*T, R)) : Bool forall T, R #

Unbinds a matching Proc(*T, R) from (emitter, signal_name).


def unbind(token : UInt64) : Bool #

Unbinds a listener slot by token.