Enum risc0_zkvm::ExitCode
source · pub enum ExitCode {
Halted(u32),
Paused(u32),
SystemSplit,
SessionLimit,
}
Expand description
Exit condition indicated by the zkVM at the end of the guest execution.
Exit codes have a “system” part and a “user” part. Semantically, the system part is set to indicate the type of exit (e.g. halt, pause, or system split) and is directly controlled by the zkVM. The user part is an exit code, similar to exit codes used in Linux, chosen by the guest program to indicate additional information (e.g. 0 to indicate success or 1 to indicate an error).
Variants§
Halted(u32)
This indicates normal termination of a program with an interior exit code returned from the guest program. A halted program cannot be resumed.
Paused(u32)
This indicates the execution ended in a paused state with an interior exit code set by the guest program. A paused program can be resumed such that execution picks up where it left of, with the same memory state.
SystemSplit
This indicates the execution ended on a host-initiated system split.
System split is mechanism by which the host can temporarily stop execution of the guest. Execution ended in a system split has no output and no conclusions can be drawn about whether the program will eventually halt. System split is used in continuations to split execution into individually provable segments.
SessionLimit
This indicates that the guest exited upon reaching the session limit set by the host.
NOTE: The current version of the RISC Zero zkVM will never exit with an exit code of SessionLimit. This is because the system cannot currently prove that the session limit as been reached.
Trait Implementations§
source§impl<'de> Deserialize<'de> for ExitCode
impl<'de> Deserialize<'de> for ExitCode
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for ExitCode
impl PartialEq for ExitCode
impl Copy for ExitCode
impl Eq for ExitCode
impl StructuralPartialEq for ExitCode
Auto Trait Implementations§
impl Freeze for ExitCode
impl RefUnwindSafe for ExitCode
impl Send for ExitCode
impl Sync for ExitCode
impl Unpin for ExitCode
impl UnwindSafe for ExitCode
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.