Skip to main content

leave

Function leave 

Source
pub fn leave() -> !
Expand description

Break the current execution.

Use this function to break the current message processing and save the state.

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

ยงExamples

use gcore::exec;

#[unsafe(no_mangle)]
extern "C" fn handle() {
    if exec::gas_available() < 1_000_000 {
        exec::leave();
    }
}