#[repr(u32)]pub enum FfiStatus {
Ok = 0,
Exception = 1,
Fatal = 99,
}Expand description
Discriminator for FfiReturn::status.
On the wire the status is a plain u32 (an arbitrary integer from a
plugin must not become a Rust enum); decode with
FfiStatus::from_u32, encode with as u32.
Variants§
Ok = 0
Success - value is the call’s result.
Exception = 1
value is the exception instance.
From a host callback this is the exception generic code raised,
handed over with full identity: returning the same value (the safe
wrapper’s ? does) re-raises exactly that exception - class,
fields, and original stack trace intact. To throw a fresh
exception, create the instance with HostApi::exception_new and
return it under this status; a caught one can be examined with
HostApi::is_instance against a class from
HostApi::builtin_get.
Fatal = 99
A fatal host runtime error passing through the plugin.
Not an exception - it is uncatchable. A re-entering host
callback returns it when the interpreter hit a fatal error; the
plugin must forward it unchanged (the safe wrapper’s ? does), and
the host re-raises it as a fatal error when the plugin call
returns. value carries no meaning for this status.