ResultExtensions<T, E> extension
Extension methods for Result
- on
-
- Result<
T, E>
- Result<
Methods
-
bind<
U> (Result< U, E> f(T)) → Result<U, E> -
Available on Result<
Performs a bind operation and returns a new instance with a new type. The 'bind' method allows chaining operations that may fail.T, E> , provided by the ResultExtensions extension -
map<
U> (U f(T)) → Result< U, E> -
Available on Result<
The 'map' method transforms the successful value without changing the error.T, E> , provided by the ResultExtensions extension -
match<
U> ({required U onSuccess(T), required U onError(E)}) → U -
Available on Result<
Achieves the same thing as a switch expression with pattern matching. You should consider using a switch expression, but sometimes the match function is simplerT, E> , provided by the ResultExtensions extension -
merge<
M, J> (Result< J, E> other, M onJoin(T, J)) → Result<M, E> -
Available on Result<
Performs a merge operation and returns a new instance ofT, E> , provided by the ResultExtensions extensionM. -
resultOr(
T or) → T -
Available on Result<
Returns the result a the specified valueT, E> , provided by the ResultExtensions extension
Operators
-
operator >>(
Result< T, E> transform(T)) → Result<T, E> -
Available on Result<
Performs a bind operation and returns a new instance.T, E> , provided by the ResultExtensions extension -
operator |(
T or) → T -
Available on Result<
Returns the success value if it exists, otherwise returnsT, E> , provided by the ResultExtensions extensionor