|
| template absl::AnyInvocable< void() && > | WrapConsuming< void > (absl::AnyInvocable< void() && >, std::string_view) |
| | For a11::Schedule and a11::ScheduleCancelable: work run once and discarded.
|
| |
| template<typename Callable > |
| absl::Status | Attempt (Callable &&callable, std::string_view what) |
| | Runs callable, reporting anything it throws as a Status.
|
| |
| template<typename Result , typename... Args> |
| std::function< Result(Args...)> | Wrap (std::function< Result(Args...)> callable, std::string_view what) |
| | Wraps callable so that anything it throws becomes a failure.
|
| |
| template<typename Result , typename... Args> |
| absl::AnyInvocable< Result(Args...)> | WrapOnce (absl::AnyInvocable< Result(Args...)> callable, std::string_view what) |
| | Wrap for a move-only callable.
|
| |
| template<typename Result , typename... Args> |
| absl::AnyInvocable< Result(Args...) && > | WrapConsuming (absl::AnyInvocable< Result(Args...) && > callable, std::string_view what) |
| | Wrap for a callable that is consumed by its one invocation.
|
| |
template<typename Callable >
| absl::Status a11::exception_guard::Attempt |
( |
Callable && |
callable, |
|
|
std::string_view |
what |
|
) |
| |
Runs callable, reporting anything it throws as a Status.
For a template in a header, where the instantiating translation unit is both the one that supplies the callable and the one that decides whether exceptions exist. See the file comment: inside A11 this is a plain call, and it is not the tool for a callable stored by A11 and invoked later.
- Parameters
-
| callable | Anything invocable with no arguments and no return value. |
| what | How to name it in the error, e.g. "on_message". |
- Returns
- OK, or what the callable threw.