exit

Function exit 

Source
pub fn exit(inheritor_id: ActorId) -> !
Expand description

Terminate the execution of a program.

The program and all corresponding data are removed from the storage. It may be called in the init method as well. One can consider this function as some analog of std::process::exit.

inheritor_id specifies the address to which all available program value should be transferred.

Note: All registered global destructors (via gcore::dtor!()/gcore::ctor::atexit) are invoked before termination.

ยงExamples

Terminate the program and transfer the available value to the message sender:

use gcore::{exec, msg};

#[unsafe(no_mangle)]
extern "C" fn handle() {
    // ...
    exec::exit(msg::source());
}