[][src]Function clear_on_drop::clear_stack_on_return_fnonce

pub fn clear_stack_on_return_fnonce<F, R>(pages: usize, f: F) -> R where
    F: FnOnce() -> R, 

Calls a closure and overwrites its stack on return.

This function is a variant of clear_stack_on_return which also accepts FnOnce, at the cost of being slightly slower.

Example

let input = vec![97, 98, 99];
let result = clear_stack_on_return_fnonce(1, || encrypt(input));