mirror of
https://github.com/napi-rs/napi-rs.git
synced 2025-12-08 19:56:07 +00:00
chore(napi): mark SendableResolver and PromiseRaw as pub (#2981)
This commit is contained in:
parent
e2a4ee6548
commit
dd2625339e
@ -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,
|
||||
|
||||
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user