Result
Extends: RefCounted
Description
A virtual class that represents an arbitrary result from executing an operation. This class should never be used directly, it's only meant to be inherited from. The Result. All classes that expose operations which may fail, will also expose a "Status" enum that can be used to distinguish the different failure modes.
A virtual class that represents an arbitrary result from executing an operation. This class should never be used directly, it's only meant to be inherited from. The Result. All classes that expose operations which may fail, will also expose a "Status" enum that can be used to distinguish the different failure modes.
Method Descriptions
_init
is_ok
Returns true if the operation succeeded
is_err
Returns true if the operation failed
tag
Returns a tag representing the status of the operation. This can be used in pattern matching. Consult the [Status] enum of the class.
sequence (static)
Convert an [Array] of [Result]s into a [Result] containing either an [Array] with [b]all[/b] of the values or the first error found in the [Array].
Sub-classes
Ok
Property Descriptions
value
- Getter:
@value_getter
Method Descriptions
_init
Err
Property Descriptions
error
- Getter:
@error_getter
Method Descriptions
_init
VariantResult
Property Descriptions
value
- Getter:
@value_getter
WARNING: This function may fail! First match on Result.tag or call Result.is_ok.
error
- Getter:
@error_getter
WARNING: This function may fail! First match on Result.tag or call Result._is_err.
ArrayResult
Property Descriptions
value
- Getter:
@value_getter
WARNING: This function may fail! First match on Result.tag or call Result.is_ok.
error
- Getter:
@error_getter
WARNING: This function may fail! First match on Result.tag or call Result._is_err.