struct Godot::AwaitStatus(T)

Overview

Zero-allocation status wrapper carrying completion state and optional unboxed value. Provides .completed?, .timed_out?, .freed?, .disposed?, .ok?, .status, .value, .value!, .value?, and delegates element access and methods to the underlying value.

Defined in:

libgodot/signals/subscription.cr

Constructors

Macro Summary

Instance Method Summary

Instance methods inherited from class Object

try?(&)
try?
try?

Constructor Detail

def self.completed(value : T | Nil = nil) : self #

Factory constructors


def self.disposed(instance_id : UInt64 = 0_u64) : self #

def self.freed(instance_id : UInt64 = 0_u64) : self #

def self.new(status : AwaitState, value : T | Nil = nil, instance_id : UInt64 = 0_u64) #

def self.timed_out : self #

Macro Detail

macro method_missing(call) #

Instance Method Detail

def ==(other : AwaitState) : Bool #

Equality comparisons for state, symbols, and values


def ==(other : Symbol) : Bool #

def ==(other : T) : Bool #

def [](index : Int) #

Index delegation for Tuple / Array destructuring: Allows a, b = status when T is an Indexable or Tuple!


def completed? : Bool #

Returns true if the operation completed successfully without timing out or being freed.


def disposed? : Bool #

Alias to #freed?.


def freed? : Bool #

Returns true if the target object was freed/disposed before or during the wait.


def instance_id : UInt64 #

def ok? : Bool #

Alias to #completed?.


def status : AwaitState #

def timed_out? : Bool #

Returns true if the operation timed out.


def to_s(io : IO) : Void #
Description copied from struct Struct

Same as #inspect(io).


def value : T | Nil #

def value! : T #

Returns the unwrapped value of type T if completed, or raises Godot::DisposedObjectError if freed or Godot::TimeoutError if timed out.


def value? : T | Nil #

Returns the value if completed, or nil if timed out or freed.