rustler 0.20.0

Safe Rust wrappers for creating Erlang NIF functions
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use super::wrapper::nif_interface::enif_consume_timeslice;
use super::Env;

pub enum SchedulerFlags {
    Normal = 0,
    DirtyCpu = 1,
    DirtyIo = 2,
}

pub fn consume_timeslice<'a>(env: Env<'a>, percent: i32) -> bool {
    let success = unsafe { enif_consume_timeslice(env.as_c_arg(), percent) };
    success == 1
}