Result<T, E>.err constructor

const Result<T, E>.err(
  1. E error
)

Creates an Err with the given error.

Examples

// prints "Err(error)"
print(Result<int, String>.err('error'));

Implementation

const factory Result.err(E error) = Err<T, E>;