andThen<U> method

Result<U, E> andThen<U>(
  1. Result<U, E> fn(
    1. T
    )
)

Returns a Result value as Err<U, E> if this Result is Err<T, E>, otherwise calls fn with the held Ok value and returns the returned Result.

See also: Rust: Result::and_then()

Implementation

Result<U, E> andThen<U>(Result<U, E> Function(T) fn) => switch (this) {
	Ok(:T v) => fn(v),
	Err(:E e) => Err(e)
};