macro_rules! fail { ($cx:expr, $msg:literal) => { ... }; ($cx:expr, $fmt:literal $(, $arg:expr)*) => { ... }; ($cx:expr, $error:expr) => { ... }; }
Expand description
Indicate failure of the actor
ⓘ
fail!(cx, "format...", fmt-args...);
fail!(cx, "literal...");
fail!(cx, error);
The first form creates a formatted string using format!
, and
passes it to Cx::fail_string
. The second form passes the
given literal directly to Cx::fail_str
. The third form passes
the given error expression directly to Cx::fail
.
As soon as the currently-running actor call finishes, the actor
will be terminated. Actor state will be dropped, and any further
calls to this actor will be discarded. The termination status is
passed back to the StopCause
handler provided when the actor
was created.