Struct napi::bindgen_prelude::BigInt
source · [−]Expand description
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 + …)
Fields
sign_bit: bool
true for negative numbers
words: Vec<u64>
Implementations
sourceimpl BigInt
impl BigInt
sourcepub fn get_u64(&self) -> (bool, u64, bool)
pub fn get_u64(&self) -> (bool, u64, bool)
(signed, value, lossless)
get the first word of the BigInt as u64
return true in the last element of tuple if the value is lossless
or the value is truncated
sourcepub fn get_i64(&self) -> (i64, bool)
pub fn get_i64(&self) -> (i64, bool)
(value, lossless)
get the first word of the BigInt as i64
return true if the value is lossless
or the value is truncated
Trait Implementations
sourceimpl FromNapiValue for BigInt
impl FromNapiValue for BigInt
sourceunsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self>
sourceimpl ToNapiValue for BigInt
impl ToNapiValue for BigInt
sourceunsafe fn to_napi_value(env: napi_env, val: Self) -> Result<napi_value>
unsafe fn to_napi_value(env: napi_env, val: Self) -> Result<napi_value>
Safety Read more
sourceimpl ValidateNapiValue for BigInt
impl ValidateNapiValue for BigInt
Auto Trait Implementations
impl RefUnwindSafe for BigInt
impl Send for BigInt
impl Sync for BigInt
impl Unpin for BigInt
impl UnwindSafe for BigInt
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more