API reference
API reference
Select your platform
No SDKs available
No versions available

OVRResult Class

Extends IEquatable< OVRResult< TStatus > >, IEquatable< OVRResult< TValue, TStatus > >
Represents a result with a status code of type TStatus .
Represents a result with a value of type TValue and a status code of type TStatus .
The OVRResult<TStatus> struct provides a wrapper around a status code and exposes properties for success and status retrieval.
An OVRResult<TValue,TStatus> represents the result of an operation which may fail. If the operation succeeds (Success is True), then you can access the value using the Value property.
If it fails (Success is False), then the OVRResult does not have a value, and it is an error to access the Value property. In this case, the Status property will contain an error code.

Properties

HasValue : bool
[Get]
Gets a bool indicating whether the result has a value.
Signature
bool OVRResult< TValue, TStatus >.HasValue
Status : TStatus
[Get]
Gets the status of the result.
Signature
TStatus OVRResult< TValue, TStatus >::Status
Success : bool
[Get]
Gets a bool indicating whether the result is a success.
Signature
bool OVRResult< TValue, TStatus >::Success
Value : TValue
[Get]
The value of the result.
It is an error to access this property unless Success is True. See also TryGetValue.
Signature
TValue OVRResult< TValue, TStatus >.Value

Methods

Equals ( other )
Determines whether the current OVRResult<TStatus> is equal to another OVRResult<TStatus>.
Signature
bool OVRResult< TValue, TStatus >.Equals(OVRResult< TStatus > other)
Parameters
other: OVRResult< TStatus >  The OVRResult<TStatus> to compare with the current one.
Returns
bool true if the specified OVRResult<TStatus> is equal to the current OVRResult<TStatus>; otherwise, false.
Equals ( obj )
Determines whether the current OVRResult<TStatus> is equal to another object.
Signature
override bool OVRResult< TValue, TStatus >.Equals(object obj)
Parameters
obj: object  The object to compare with the current OVRResult<TStatus>.
Returns
override bool true if the specified object is equal to the current OVRResult<TStatus>; otherwise, false.
Equals ( other )
Determines whether the current OVRResult<TValue, TStatus> is equal to another OVRResult<TValue, TStatus>.
Signature
bool OVRResult< TValue, TStatus >.Equals(OVRResult< TValue, TStatus > other)
Parameters
other: OVRResult< TValue, TStatus >  The OVRResult<TValue, TStatus> to compare with the current one.
Returns
bool true if the specified OVRResult<TValue, TStatus> is equal to the current OVRResult<TValue, TStatus>; otherwise, false.
Equals ( obj )
Determines whether the current OVRResult<TValue, TStatus> is equal to another object.
Signature
override bool OVRResult< TValue, TStatus >.Equals(object obj)
Parameters
obj: object  The object to compare with the current OVRResult<TValue, TStatus>.
Returns
override bool true if the specified object is equal to the current OVRResult<TValue, TStatus>; otherwise, false.
Equals ()
Signature
override bool TStatus other && OVRResult< TValue, TStatus >.Equals(other)
Parameters
other
Returns
override bool TStatus other &&
GetHashCode ()
Gets a hashcode suitable for use in a Dictionary or HashSet.
Signature
override int OVRResult< TValue, TStatus >.GetHashCode()
Returns
override int  A hashcode for this result.
GetHashCode ()
Gets a hashcode suitable for use in a Dictionary or HashSet.
Signature
override int OVRResult< TValue, TStatus >.GetHashCode()
Returns
override int  A hashcode for this result.
ToString ()
Generates a string representation of this result object.
The string representation is the stringification of Status, or "(invalid result)" if this result object has not been initialized.
Signature
override string OVRResult< TValue, TStatus >.ToString()
Returns
override string  A string representation of this OVRResult<TStatus>
ToString ()
Generates a string representation of this result object.
If this result object has not been initialized, the string is "(invalid result)". Otherwise, if Success is True, then the string is the stringification of the Status and Value. If Success is False, then it is just the stringification of Status.
Signature
override string OVRResult< TValue, TStatus >.ToString()
Returns
override string  A string representation of this OVRResult<TStatus>
TryGetValue ( value )
Tries to retrieve the value of the result.
Signature
bool OVRResult< TValue, TStatus >.TryGetValue(out TValue value)
Parameters
value: out TValue  When this method returns, contains the value of the result if the result was successful; otherwise, the default value.
Returns
bool true if the result was successful and the value is retrieved; otherwise, false.

Static Methods

From ( status )
Creates a new OVRResult<TValue, TStatus> with the specified status.
Signature
static OVRResult< TStatus > OVRResult< TValue, TStatus >.From(TStatus status)
Parameters
status: TStatus  The status.
Returns
OVRResult< TStatus >  A new OVRResult<TValue, TStatus> with the specified status.
From ( value , status )
Creates a new OVRResult<TValue, TStatus> with the specified value and status.
Signature
static OVRResult< TValue, TStatus > OVRResult< TValue, TStatus >.From(TValue value, TStatus status)
Parameters
value: TValue  The value.
status: TStatus  The status.
Returns
OVRResult< TValue, TStatus >  A new OVRResult<TValue, TStatus> with the specified value and status.
From< TResult, TStatus > ( result , status )
Signature
static OVRResult< TResult, TStatus > OVRResult< TValue, TStatus >.From< TResult, TStatus >(TResult result, TStatus status)
Parameters
result: TResult
status: TStatus
Returns
OVRResult< TResult, TStatus >
From< TStatus > ( status )
Signature
static OVRResult< TStatus > OVRResult< TValue, TStatus >.From< TStatus >(TStatus status)
Parameters
status: TStatus
Returns
OVRResult< TStatus >
FromFailure ( status )
Creates a new OVRResult<TValue, TStatus> with the specified failure status.
Signature
static OVRResult< TStatus > OVRResult< TValue, TStatus >.FromFailure(TStatus status)
Parameters
status: TStatus  The status (must be a valid failure status).
Returns
OVRResult< TStatus >  A new OVRResult<TValue, TStatus> with the specified status.
Throws
ArgumentException  Thrown when status is not a valid failure status.
FromFailure ( status )
Creates a new OVRResult<TValue, TStatus> with the specified failure status.
Signature
static OVRResult< TValue, TStatus > OVRResult< TValue, TStatus >.FromFailure(TStatus status)
Parameters
status: TStatus  The status (must be a valid failure status).
Returns
OVRResult< TValue, TStatus >  A new OVRResult<TValue, TStatus> with the specified status.
Throws
ArgumentException  Thrown when status is not a valid failure status.
FromSuccess ( status )
Creates a new OVRResult<TValue, TStatus> with the specified success status.
Signature
static OVRResult< TStatus > OVRResult< TValue, TStatus >.FromSuccess(TStatus status)
Parameters
status: TStatus  The status (must be a valid success status).
Returns
OVRResult< TStatus >  A new OVRResult<TValue, TStatus> with the specified status.
Throws
ArgumentException  Thrown when status is not a valid success status.
FromSuccess ( value , status )
Creates a new OVRResult<TValue, TStatus> with the specified value and a success status.
Signature
static OVRResult< TValue, TStatus > OVRResult< TValue, TStatus >.FromSuccess(TValue value, TStatus status)
Parameters
value: TValue  The value.
status: TStatus  The status (must be a valid success status).
Returns
OVRResult< TValue, TStatus >  A new OVRResult<TValue, TStatus> with the specified value and status.
Throws
ArgumentException  Thrown when status is not a valid success status.