Function xrpl_hooks::api::_g[][src]

pub fn _g(id: u32, maxiter: u32)
Expand description

Guard function

Each time a loop appears in your code a call to this must be the first branch instruction in wasm binary after the beginning of the loop. In order to achieve this in Rust use the while loop with expression block.

Example

let mut i = 0;
while {
    _g(UNIQUE_GUARD_ID, MAXITER);
    i < MAXITER
} {
    // your code
    i += 1;
}