chore(napi): mark SendableResolver and PromiseRaw as pub (#2981)

This commit is contained in:
richerfu 2025-10-29 15:12:09 +08:00 committed by GitHub
parent e2a4ee6548
commit dd2625339e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -56,7 +56,7 @@ impl<T> FromNapiValue for PromiseRaw<'_, T> {
}
impl<T> PromiseRaw<'_, T> {
pub(crate) fn new(env: sys::napi_env, inner: sys::napi_value) -> Self {
pub fn new(env: sys::napi_env, inner: sys::napi_value) -> Self {
Self {
inner,
env,

View File

@ -171,7 +171,7 @@ pub fn within_runtime_if_available<F: FnOnce() -> T, T>(f: F) -> T {
}
#[cfg(not(feature = "noop"))]
struct SendableResolver<
pub struct SendableResolver<
Data: 'static + Send,
R: 'static + FnOnce(sys::napi_env, Data) -> Result<sys::napi_value>,
> {
@ -193,14 +193,14 @@ unsafe impl<Data: 'static + Send, R: 'static + FnOnce(sys::napi_env, Data) -> Re
impl<Data: 'static + Send, R: 'static + FnOnce(sys::napi_env, Data) -> Result<sys::napi_value>>
SendableResolver<Data, R>
{
fn new(inner: R) -> Self {
pub fn new(inner: R) -> Self {
Self {
inner,
_data: PhantomData,
}
}
fn resolve(self, env: sys::napi_env, data: Data) -> Result<sys::napi_value> {
pub fn resolve(self, env: sys::napi_env, data: Data) -> Result<sys::napi_value> {
(self.inner)(env, data)
}
}