feat(napi): expose uv_run (#1499)
Signed-off-by: MarkusJx <28785953+MarkusJx@users.noreply.github.com>
This commit is contained in:
parent
fc101d0d6b
commit
86cfbca33e
2 changed files with 10 additions and 0 deletions
|
@ -487,10 +487,13 @@ mod napi1 {
|
|||
#[cfg(feature = "napi2")]
|
||||
mod napi2 {
|
||||
use super::super::types::*;
|
||||
use std::os::raw::c_int;
|
||||
|
||||
generate!(
|
||||
extern "C" {
|
||||
fn napi_get_uv_event_loop(env: napi_env, loop_: *mut *mut uv_loop_s) -> napi_status;
|
||||
|
||||
fn uv_run(loop_: *mut uv_loop_s, mode: uv_run_mode) -> c_int;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -55,6 +55,13 @@ pub struct napi_deferred__ {
|
|||
pub struct uv_loop_s {
|
||||
_unused: [u8; 0],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum uv_run_mode {
|
||||
UV_RUN_DEFAULT = 0,
|
||||
UV_RUN_ONCE = 1,
|
||||
UV_RUN_NOWAIT = 2,
|
||||
}
|
||||
pub type napi_deferred = *mut napi_deferred__;
|
||||
|
||||
pub type napi_property_attributes = i32;
|
||||
|
|
Loading…
Reference in a new issue