Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Method

UnwrapOr

func UnwrapOr<T, E>(defaultValue: T) -> T

Declaring type: ResultOperators
Module: System
Assembly: System.Runtime.dll

Extension from ResultOperators.UnwrapOr

Returns the successful value, or the supplied fallback value.

Parameters

Name Type Description
self Result<T, E> The source outcome or iterable on which the extension operates.
defaultValue T The fallback returned when no successful value is available.

Return value

T