struct
Godot::AwaitStatus(T)
- Godot::AwaitStatus(T)
- Struct
- Value
- Object
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.crConstructors
-
.completed(value : T | Nil = nil) : self
Factory constructors
- .disposed(instance_id : UInt64 = 0_u64) : self
- .freed(instance_id : UInt64 = 0_u64) : self
- .new(status : AwaitState, value : T | Nil = nil, instance_id : UInt64 = 0_u64)
- .timed_out : self
Macro Summary
Instance Method Summary
-
#==(other : AwaitState) : Bool
Equality comparisons for state, symbols, and values
- #==(other : Symbol) : Bool
- #==(other : T) : Bool
-
#[](index : Int)
Index delegation for Tuple / Array destructuring: Allows
a, b = statuswhen T is an Indexable or Tuple! -
#completed? : Bool
Returns true if the operation completed successfully without timing out or being freed.
-
#disposed? : Bool
Alias to
#freed?. -
#freed? : Bool
Returns true if the target object was freed/disposed before or during the wait.
- #instance_id : UInt64
-
#ok? : Bool
Alias to
#completed?. - #status : AwaitState
-
#timed_out? : Bool
Returns true if the operation timed out.
-
#to_s(io : IO) : Void
Same as
#inspect(io). - #value : T | Nil
-
#value! : T
Returns the unwrapped value of type T if completed, or raises
Godot::DisposedObjectErrorif freed orGodot::TimeoutErrorif timed out. -
#value? : T | Nil
Returns the value if completed, or nil if timed out or freed.
Instance methods inherited from class Object
try?(&)try? try?
Constructor Detail
Macro Detail
Instance Method Detail
Index delegation for Tuple / Array destructuring:
Allows a, b = status when T is an Indexable or Tuple!
Returns true if the operation completed successfully without timing out or being freed.
Returns the unwrapped value of type T if completed, or raises Godot::DisposedObjectError if freed
or Godot::TimeoutError if timed out.