doc: cargo docs fix

This commit is contained in:
LongYinan 2021-11-23 14:47:37 +08:00
parent f83e167bd2
commit 43d21c51d2
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7
6 changed files with 7 additions and 7 deletions

View file

@ -19,8 +19,8 @@ use super::{FromNapiValue, ToNapiValue, TypeName};
#[allow(non_camel_case_types)]
pub struct i64n(pub i64);
/// 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 + …)
/// <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 + …)
pub struct BigInt {
/// true for negative numbers
pub sign_bit: bool,

View file

@ -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 {
raw_work: Rc<AtomicPtr<napi_sys::napi_async_work__>>,
raw_deferred: Rc<AtomicPtr<napi_sys::napi_deferred__>>,

View file

@ -229,7 +229,7 @@ impl DerefMut for JsArrayBufferValue {
impl JsTypedArray {
/// 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.
pub fn into_value(self) -> Result<JsTypedArrayValue> {

View file

@ -196,7 +196,7 @@ impl TryFrom<JsBigInt> for u64 {
}
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>)> {
let mut words: Vec<u64> = Vec::with_capacity(self.word_count as usize);
let word_count = &mut self.word_count;

View file

@ -94,7 +94,7 @@ impl JsFunction {
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.
pub fn new_instance<V>(&self, args: &[V]) -> Result<JsObject>

View file

@ -437,7 +437,7 @@ macro_rules! impl_object_methods {
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
#[cfg(feature = "napi6")]
pub fn get_all_property_names(