[−][src]Struct rusty_v8::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]
scope: &mut HandleScope<'s>,
value: i64
) -> Local<'s, BigInt>
pub fn new_from_u64<'s>(
scope: &mut HandleScope<'s>,
value: u64
) -> Local<'s, BigInt>
[src]
scope: &mut HandleScope<'s>,
value: u64
) -> Local<'s, BigInt>
pub fn new_from_words<'s>(
scope: &mut HandleScope<'s>,
sign_bit: bool,
words: &[u64]
) -> Option<Local<'s, BigInt>>
[src]
scope: &mut HandleScope<'s>,
sign_bit: bool,
words: &[u64]
) -> Option<Local<'s, BigInt>>
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.
pub fn deref(&self) -> &Self::Target
[src]
impl Eq for BigInt
[src]
impl Hash for BigInt
[src]
pub fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'s> PartialEq<BigInt> for Value
[src]
pub fn eq(&self, other: &BigInt) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'s> PartialEq<BigInt> for Primitive
[src]
pub fn eq(&self, other: &BigInt) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'s> PartialEq<BigInt> for BigInt
[src]
pub fn eq(&self, other: &BigInt) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'s> PartialEq<Primitive> for BigInt
[src]
pub fn eq(&self, other: &Primitive) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,