ResultInfo struct
The outcome of a native call: a ResultInfo.StatusCode and a diagnostic message.
Namespace: Quaternar.Qaros · Assembly: Quaternar.Qaros.dll
public readonly struct ResultInfo : IEquatable<ResultInfo>
Implements: IEquatable<ResultInfo>
Remarks
Some failures are expected control flow rather than errors, for example
StatusCode.OnboardingSessionNotFound from a rejoin. Equality compares
ResultInfo.StatusCode only; the message and ResultInfo.ErrorHandle are ignored.
Constructors
ResultInfo(StatusCode, uint, string)
public ResultInfo(StatusCode statusCode, uint errorHandle, string message)
Parameters
| Name | Type | Description |
|---|---|---|
statusCode | StatusCode | |
errorHandle | uint | |
message | string |
Properties
| Member | Description |
|---|---|
| StatusCode | |
| ErrorHandle | The native diagnostic object behind a failure; 0 on success. |
| Message | |
| IsSuccess |
StatusCode
public StatusCode StatusCode { get; }
Value: StatusCode
ErrorHandle
The native diagnostic object behind a failure; 0 on success.
public uint ErrorHandle { get; }
Value: uint
Message
public string Message { get; }
Value: string
IsSuccess
public bool IsSuccess { get; }
Value: bool
Methods
| Member | Description |
|---|---|
| EnsureSuccess() | |
| ToString() | Returns the fully qualified type name of this instance. |
| Equals(ResultInfo) | Indicates whether the current object is equal to another object of the same type. |
| Equals(object?) | Indicates whether this instance and a specified object are equal. |
| GetHashCode() | Returns the hash code for this instance. |
EnsureSuccess
public void EnsureSuccess()
Exceptions
| Exception | Condition |
|---|---|
| NativeCallException | The result is a failure. |
ToString
Returns the fully qualified type name of this instance.
public override string ToString()
Returns: string — The fully qualified type name.
Equals(ResultInfo)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(ResultInfo other)
Parameters
| Name | Type | Description |
|---|---|---|
other | ResultInfo | An object to compare with this object. |
Returns: bool — true if the current object is equal to the other parameter; otherwise, false.
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
| Name | Type | Description |
|---|---|---|
obj | object | The object to compare with the current instance. |
Returns: bool — true if obj and this instance are the same type and represent the same value; otherwise, false.
GetHashCode
Returns the hash code for this instance.
public override int GetHashCode()
Returns: int — A 32-bit signed integer that is the hash code for this instance.
Operators
operator ==
public static bool operator ==(ResultInfo left, ResultInfo right)
Parameters
| Name | Type | Description |
|---|---|---|
left | ResultInfo | |
right | ResultInfo |
Returns: bool
operator !=
public static bool operator !=(ResultInfo left, ResultInfo right)
Parameters
| Name | Type | Description |
|---|---|---|
left | ResultInfo | |
right | ResultInfo |
Returns: bool