asFailure

Casts the current object to a Failure type.

This function assumes that the calling instance is of type Failure<TResult>. Use it to retrieve the object as a Failure and access its specific properties and behaviors.

Return

The current instance cast to Failure<TResult>.

Throws

if the current instance is not of type Failure<TResult>.