Result<T, E>.from constructor
Result<T, E>.from (
- T? value,
- E error
Creates a Result
from the given nullable T
value.
Creates:
Implementation
factory Result.from(T? value, E error) {
return switch (value) {
null => Err(error),
_ => Ok(value),
};
}