Enumerationmigueldeicaza.swiftgodot 0.45.0SwiftGodot
VariantIndexerError
Errors raised by the variant subscript
Variant.swift:214enum VariantIndexerError
There are two possible error conditions, an attempt to use an indexer on a variant that is not an array, or an attempt to access an element out bounds.
Cases
case ok
case invalidOperation
The variant is not an array
case outOfBounds
The index is out of bounds
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (15) members.
Types
Type members
init(
) Creates an empty Variant, that represents the Godot type
nil
init(Variant
) Creates a new Variant based on a copy of the reference variant passed in
init(some VariantStorable
) static func typeName(GType
) -> String Gets the name of a Variant type.
static func == (lhs: Variant, rhs: Variant
) -> Bool Compares two variants, does this by delegating the comparison to Godot
Instance members
var debugDescription: String
var description: String
var gtype: GType
This describes the type of the data wrapped by this variant
var isNull: Bool
Returns true if the variant is flagged as being an object (
gtype == .object
) and it has a nil pointer.subscript(Int
) -> Variant? Variants that represent arrays can be indexed, this subscript allows you to fetch the individual elements of those arrays
func asObject<T>(T.Type
) -> T? Attempts to cast the Variant into a SwiftGodot.Object, if the variant contains a value of type
.object
, then a.object, the value
nil` is returned.func call(method: StringName, Variant...
) -> Result<Variant, CallErrorType> Invokes a variant’s method by name.
func hash(into: inout Hasher
)
Citizens in SwiftGodot
Conformances
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol Equatable
A type that can be compared for value equality.
protocol Error
A type representing an error value that can be thrown.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Sendable
A type whose values can safely be passed across concurrency domains by copying.
Instance members
Type features
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.