Returns the encapsulated data if this state is UiState.Success, or the result of onFailure function for non-success states.