doc: cargo docs fix
This commit is contained in:
parent
f83e167bd2
commit
43d21c51d2
6 changed files with 7 additions and 7 deletions
|
@ -19,8 +19,8 @@ use super::{FromNapiValue, ToNapiValue, TypeName};
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
pub struct i64n(pub i64);
|
pub struct i64n(pub i64);
|
||||||
|
|
||||||
/// https://nodejs.org/api/n-api.html#napi_create_bigint_words
|
/// <https://nodejs.org/api/n-api.html#napi_create_bigint_words>
|
||||||
/// The resulting BigInt is calculated as: (–1)^sign_bit (words[0] × (2^64)^0 + words[1] × (2^64)^1 + …)
|
/// The resulting BigInt is calculated as: (–1)^sign_bit (words\[0\] × (2^64)^0 + words\[1\] × (2^64)^1 + …)
|
||||||
pub struct BigInt {
|
pub struct BigInt {
|
||||||
/// true for negative numbers
|
/// true for negative numbers
|
||||||
pub sign_bit: bool,
|
pub sign_bit: bool,
|
||||||
|
|
|
@ -44,7 +44,7 @@ impl<T: Task> AsyncTask<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://developer.mozilla.org/zh-CN/docs/Web/API/AbortController
|
/// <https://developer.mozilla.org/zh-CN/docs/Web/API/AbortController>
|
||||||
pub struct AbortSignal {
|
pub struct AbortSignal {
|
||||||
raw_work: Rc<AtomicPtr<napi_sys::napi_async_work__>>,
|
raw_work: Rc<AtomicPtr<napi_sys::napi_async_work__>>,
|
||||||
raw_deferred: Rc<AtomicPtr<napi_sys::napi_deferred__>>,
|
raw_deferred: Rc<AtomicPtr<napi_sys::napi_deferred__>>,
|
||||||
|
|
|
@ -229,7 +229,7 @@ impl DerefMut for JsArrayBufferValue {
|
||||||
|
|
||||||
impl JsTypedArray {
|
impl JsTypedArray {
|
||||||
/// get TypeArray info
|
/// get TypeArray info
|
||||||
/// https://nodejs.org/api/n-api.html#n_api_napi_get_typedarray_info
|
/// <https://nodejs.org/api/n-api.html#n_api_napi_get_typedarray_info>
|
||||||
///
|
///
|
||||||
/// ***Warning***: Use caution while using this API since the underlying data buffer is managed by the VM.
|
/// ***Warning***: Use caution while using this API since the underlying data buffer is managed by the VM.
|
||||||
pub fn into_value(self) -> Result<JsTypedArrayValue> {
|
pub fn into_value(self) -> Result<JsTypedArrayValue> {
|
||||||
|
|
|
@ -196,7 +196,7 @@ impl TryFrom<JsBigInt> for u64 {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl JsBigInt {
|
impl JsBigInt {
|
||||||
/// https://nodejs.org/api/n-api.html#n_api_napi_get_value_bigint_words
|
/// <https://nodejs.org/api/n-api.html#n_api_napi_get_value_bigint_words>
|
||||||
pub fn get_words(&mut self) -> Result<(bool, Vec<u64>)> {
|
pub fn get_words(&mut self) -> Result<(bool, Vec<u64>)> {
|
||||||
let mut words: Vec<u64> = Vec::with_capacity(self.word_count as usize);
|
let mut words: Vec<u64> = Vec::with_capacity(self.word_count as usize);
|
||||||
let word_count = &mut self.word_count;
|
let word_count = &mut self.word_count;
|
||||||
|
|
|
@ -94,7 +94,7 @@ impl JsFunction {
|
||||||
unsafe { JsUnknown::from_raw(self.0.env, return_value) }
|
unsafe { JsUnknown::from_raw(self.0.env, return_value) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://nodejs.org/api/n-api.html#n_api_napi_new_instance
|
/// <https://nodejs.org/api/n-api.html#n_api_napi_new_instance>
|
||||||
///
|
///
|
||||||
/// This method is used to instantiate a new `JavaScript` value using a given `JsFunction` that represents the constructor for the object.
|
/// This method is used to instantiate a new `JavaScript` value using a given `JsFunction` that represents the constructor for the object.
|
||||||
pub fn new_instance<V>(&self, args: &[V]) -> Result<JsObject>
|
pub fn new_instance<V>(&self, args: &[V]) -> Result<JsObject>
|
||||||
|
|
|
@ -437,7 +437,7 @@ macro_rules! impl_object_methods {
|
||||||
Ok(unsafe { JsObject::from_raw_unchecked(self.0.env, raw_value) })
|
Ok(unsafe { JsObject::from_raw_unchecked(self.0.env, raw_value) })
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://nodejs.org/api/n-api.html#n_api_napi_get_all_property_names
|
/// <https://nodejs.org/api/n-api.html#n_api_napi_get_all_property_names>
|
||||||
/// return `Array` of property names
|
/// return `Array` of property names
|
||||||
#[cfg(feature = "napi6")]
|
#[cfg(feature = "napi6")]
|
||||||
pub fn get_all_property_names(
|
pub fn get_all_property_names(
|
||||||
|
|
Loading…
Reference in a new issue