Err<T, E> class

Implemented types

Constructors

Err(E error)

Properties

asErr Err<T, E>
no setteroverride
asOk Ok<T, E>
no setteroverride
error → E
final
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

andThen<U, F>(Result<U, F> f(T t)) Result<U, F>
Similar to map Except you must return a new Result.
override
asyncAndThen<U, F>(ResultAsync<U?, F?> f(T t)) ResultAsync<U, F>
Similar to map Except you must return a new Result.
override
asyncMap<U>(Future<U> f(T t)) ResultAsync<U, E>
Maps a Result<T, E> to ResultAsync<U, E> by applying an async function to a contained Ok value, leaving an Err value untouched.
override
isErr() bool
Used to check if a Result is an Err
override
isOk() bool
Used to check if a Result is an OK
override
map<A>(A f(T t)) Result<A, E>
Maps a Result<T, E> to Result<U, E> by applying a function to a contained Ok value, leaving an Err value untouched.
override
mapErr<U>(U f(E error)) Result<T, U>
Maps a Result<T, E> to Result<T, F> by applying a function to a contained Err value, leaving an Ok value untouched.
override
match<A>(A ok(T t), A err(E e)) → A
Given 2 functions (one for the Ok variant and one for the Err variant) execute the function that matches the Result variant.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
orElse<A>(Result<T, A> f(E error)) Result<T, A>
Takes an Err value and maps it to a Result<T, SomeNewType>.
override
safeUnwrap() Stream<T>
Emulates Rust's ? operator in safeTry's body. See also safeTry.
override
toString() String
A string representation of this object.
inherited
unsafeUnwrap({ErrorConfig? config}) → T
This method is unsafe, and should only be used in a test environments
override
unsafeUnwrapErr({ErrorConfig? config}) → E
This method is unsafe, and should only be used in a test environments
override
unwrapOr(T v) → T
Unwrap the Ok value, or return the default if there is an Err
override

Operators

operator ==(Object other) bool
The equality operator.
override