[][src]Struct rusty_v8::BigInt

#[repr(C)]pub struct BigInt(_);

A JavaScript BigInt value (https://tc39.github.io/proposal-bigint)

Implementations

impl BigInt[src]

pub fn new_from_i64<'s>(
    scope: &mut HandleScope<'s>,
    value: i64
) -> Local<'s, BigInt>
[src]

pub fn new_from_u64<'s>(
    scope: &mut HandleScope<'s>,
    value: u64
) -> Local<'s, BigInt>
[src]

pub fn new_from_words<'s>(
    scope: &mut HandleScope<'s>,
    sign_bit: bool,
    words: &[u64]
) -> Option<Local<'s, BigInt>>
[src]

Creates a new BigInt object using a specified sign bit and a specified list of digits/words. The resulting number is calculated as:

(-1)^sign_bit * (words[0] * (2^64)^0 + words[1] * (2^64)^1 + ...)

pub fn u64_value(&self) -> (u64, bool)[src]

Returns the value of this BigInt as an unsigned 64-bit integer, and a bool indicating whether the return value was truncated was truncated or wrapped around. In particular, it will be false if this BigInt is negative.

pub fn i64_value(&self) -> (i64, bool)[src]

Returns the value of this BigInt as a signed 64-bit integer, and a bool indicating whether this BigInt was truncated or not.

pub fn word_count(&self) -> usize[src]

Returns the number of 64-bit words needed to store the result of to_words_array.

pub fn to_words_array<'a>(&self, words: &'a mut [u64]) -> (bool, &'a mut [u64])[src]

Converts this BigInt to a (sign_bit, words) pair. sign_bit will be true if this BigInt is negative. If words has too few elements, the result will be truncated to fit.

Trait Implementations

impl Debug for BigInt[src]

impl Deref for BigInt[src]

type Target = Primitive

The resulting type after dereferencing.

impl Eq for BigInt[src]

impl Hash for BigInt[src]

impl<'s> PartialEq<BigInt> for Value[src]

impl<'s> PartialEq<BigInt> for Primitive[src]

impl<'s> PartialEq<BigInt> for BigInt[src]

impl<'s> PartialEq<Primitive> for BigInt[src]

impl<'s> PartialEq<Value> for BigInt[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.