guardAsync<S> function
Async version of guard
Implementation
@pragma("vm:prefer-inline")
FutureResult<S, Object> guardAsync<S>(Future<S> Function() func) async {
assert(S is! Result, "Use guardAsyncResult instead");
try {
return Ok(await func());
} catch (e) {
return Err(e);
}
}