class_name SingletonIterator extends Iterator

var value: Variant
var emitted: bool = false

func _init(value: Variant) -> void:
    self.value = value

func next() -> Option:
    if not emitted:
        emitted = true
        return Option.some(value)
    else:
        return Option.none
