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

OVRResult Class

Represents a result with a status code of type TStatus .
OVRResult extends IEquatable< OVRResult< TStatus > >.
OVRResult extends IEquatable< OVRResult< TValue, TStatus > >.

Overview

Properties

bool
Success[Get]
Gets a bool indicating whether the result is a success.
TStatus
Status[Get]
Gets the status of the result.
bool
Gets a bool indicating whether the result has a value.
TValue
Value[Get]
Gets the value of the result.

Static Public Member Functions

static OVRResult< TStatus >
From< TStatus >
( TStatus status )
static OVRResult< TResult, TStatus >
From< TResult, TStatus >
( TResult result,
TStatus status )
static OVRResult< TStatus >
From
( TStatus status )
Creates a new OVRResult<TValue, TStatus> with the specified status.
static OVRResult< TStatus >
FromSuccess
( TStatus status )
Creates a new OVRResult<TValue, TStatus> with the specified success status.
static OVRResult< TStatus >
FromFailure
( TStatus status )
Creates a new OVRResult<TValue, TStatus> with the specified failure status.
static OVRResult< TValue, TStatus >
From
( TValue value,
TStatus status )
Creates a new OVRResult<TValue, TStatus> with the specified value and status.
static OVRResult< TValue, TStatus >
FromSuccess
( TValue value,
TStatus status )
Creates a new OVRResult<TValue, TStatus> with the specified value and a success status.
static OVRResult< TValue, TStatus >
FromFailure
( TStatus status )
Creates a new OVRResult<TValue, TStatus> with the specified failure status.

Public Member Functions

bool
Equals
( OVRResult< TStatus > other )
Determines whether the current OVRResult<TStatus> is equal to another OVRResult<TStatus>.
override bool
Equals
( object obj )
Determines whether the current OVRResult<TStatus> is equal to another object.
override int
Gets a hashcode suitable for use in a Dictionary or HashSet.
bool
TryGetValue
( out TValue value )
Tries to retrieve the value of the result.
bool
Equals
( OVRResult< TValue, TStatus > other )
Determines whether the current OVRResult<TValue, TStatus> is equal to another OVRResult<TValue, TStatus>.
override bool
Equals
( object obj )
Determines whether the current OVRResult<TValue, TStatus> is equal to another object.
override bool TStatus other &&
Equals
( other )
override int
Gets a hashcode suitable for use in a Dictionary or HashSet.

Details

Detailed Description

Represents a result with a value of type TValue and a status code of type TStatus .
Others
TStatus
The type of the status code. It must have the OVRResultStatus attribute
The OVRResult<TStatus> struct provides a wrapper around a status code and exposes properties for success and status retrieval.
Others
TValue
The type of the value.
TStatus
The type of the status code.
The OVRResult<TValue, TStatus> struct provides a wrapper around a value and a status code. It exposes properties for success, status retrieval, value retrieval, and try-get-value functionality.

Properties

bool OVRResult< TValue, TStatus >::Success
Gets a bool indicating whether the result is a success.
TStatus OVRResult< TValue, TStatus >::Status
Gets the status of the result.
bool OVRResult< TValue, TStatus >.HasValue
Gets a bool indicating whether the result has a value.
TValue OVRResult< TValue, TStatus >.Value
Gets the value of the result.
Exceptions
InvalidOperationException
Thrown when the result was unsuccessful and no value is available.

Static Member Functions

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

Member Functions

bool OVRResult< TValue, TStatus >.Equals
( OVRResult< TStatus > other )
Determines whether the current OVRResult<TStatus> is equal to another OVRResult<TStatus>.
Parameters
other
The OVRResult<TStatus> to compare with the current one.
Returns
true if the specified OVRResult<TStatus> is equal to the current OVRResult<TStatus>; otherwise, false.
override bool OVRResult< TValue, TStatus >.Equals
( object obj )
Determines whether the current OVRResult<TStatus> is equal to another object.
Parameters
obj
The object to compare with the current OVRResult<TStatus>.
Returns
true if the specified object is equal to the current OVRResult<TStatus>; otherwise, false.
override int OVRResult< TValue, TStatus >.GetHashCode ( )
Gets a hashcode suitable for use in a Dictionary or HashSet.
Returns
A hashcode for this result.
bool OVRResult< TValue, TStatus >.TryGetValue
( out TValue value )
Tries to retrieve the value of the result.
Parameters
value
When this method returns, contains the value of the result if the result was successful; otherwise, the default value.
Returns
true if the result was successful and the value is retrieved; otherwise, false.
See Also:
bool OVRResult< TValue, TStatus >.Equals
( OVRResult< TValue, TStatus > other )
Determines whether the current OVRResult<TValue, TStatus> is equal to another OVRResult<TValue, TStatus>.
Parameters
other
The OVRResult<TValue, TStatus> to compare with the current one.
Returns
true if the specified OVRResult<TValue, TStatus> is equal to the current OVRResult<TValue, TStatus>; otherwise, false.
override bool OVRResult< TValue, TStatus >.Equals
( object obj )
Determines whether the current OVRResult<TValue, TStatus> is equal to another object.
Parameters
obj
The object to compare with the current OVRResult<TValue, TStatus>.
Returns
true if the specified object is equal to the current OVRResult<TValue, TStatus>; otherwise, false.
override bool TStatus other && OVRResult< TValue, TStatus >.Equals
( other )
No description available.
override int OVRResult< TValue, TStatus >.GetHashCode ( )
Gets a hashcode suitable for use in a Dictionary or HashSet.
Returns
A hashcode for this result.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon