Struct Result

Embeds a return value for an API as well as any error code and an optional message.

struct Result(T) ;

Constructors

NameDescription
this (value) Ctor when there was no error
this (error, message) Ctor when there was an error, with an optional message.

Fields

NameTypeDescription
error ErrorCodeThe error code, if any
message stringThe error message, if any
value TThe result, only valid if error != ErrorCode.None

Methods

NameDescription
toString () Convenience

Parameters

NameDescription
T the type stored as the value field