failureOrNull

Returns the current instance as a Failure if it represents a failure state. If the instance is not a failure, null is returned.

Return

the instance cast as a Failure if it represents a failure, or null otherwise.