feat(napi): expose uv_run (#1499)

Signed-off-by: MarkusJx <28785953+MarkusJx@users.noreply.github.com>
This commit is contained in:
Markus 2023-02-27 10:31:03 +01:00 committed by GitHub
parent fc101d0d6b
commit 86cfbca33e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View file

@ -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;
}
);
}

View file

@ -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;