Struct Number
#[repr(transparent)]
pub struct Number { /* private fields */ }
Implementations
impl Number
fn is_integer(value: &JsValue) -> boolThe
Number.isInteger()method determines whether the passed value is an integer.
impl Number
fn new(value: &JsValue) -> NumberThe
NumberJavaScript object is a wrapper object allowing you to work with numerical values. ANumberobject is created using theNumber()constructor.
impl Number
fn to_locale_string(&self, locale: &str) -> JsStringThe
toLocaleString()method returns a string with a language sensitive representation of this number.
impl Number
fn to_exponential(&self, fraction_digits: u8) -> Result<JsString, JsValue>The
toExponential()method returns a string representing the Number object in exponential notation.
impl Number
fn value_of(&self) -> f64The
valueOf()method returns the wrapped primitive value of a Number object.
impl Number
fn is_nan(value: &JsValue) -> boolThe
Number.isNaN()method determines whether the passed value isNaNand its type is Number. It is a more robust version of the original, global isNaN().
impl Number
fn parse_int(text: &str, radix: u8) -> f64The
Number.parseInt()method parses a string argument and returns an integer of the specified radix or base.
impl Number
fn to_precision(&self, precision: u8) -> Result<JsString, JsValue>The
toPrecision()method returns a string representing the Number object to the specified precision.
impl Number
fn to_string(&self, radix: u8) -> Result<JsString, JsValue>The
toString()method returns a string representing the specified Number object.
impl Number
const EPSILON: f64 = f64::EPSILON;The smallest interval between two representable numbers.
const MAX_SAFE_INTEGER: f64 = 9007199254740991.0;The maximum safe integer in JavaScript (2^53 - 1).
const MAX_VALUE: f64 = f64::MAX;The largest positive representable number.
const MIN_SAFE_INTEGER: f64 = -9007199254740991.0;The minimum safe integer in JavaScript (-(2^53 - 1)).
const MIN_VALUE: f64 = 5E-324;The smallest positive representable number—that is, the positive number closest to zero (without actually being zero).
const NAN: f64 = f64::NAN;Special "Not a Number" value.
const NEGATIVE_INFINITY: f64 = f64::NEG_INFINITY;Special value representing negative infinity. Returned on overflow.
const POSITIVE_INFINITY: f64 = f64::INFINITY;Special value representing infinity. Returned on overflow.
fn pow(&self, rhs: &Self) -> SelfApplies the binary
**JS operator on the twoNumbers.fn unsigned_shr(&self, rhs: &Self) -> SelfApplies the binary
>>>JS operator on the twoNumbers.
impl Number
fn is_finite(value: &JsValue) -> boolThe
Number.isFinite()method determines whether the passed value is a finite number.
impl Number
fn is_safe_integer(value: &JsValue) -> boolThe
Number.isSafeInteger()method determines whether the provided value is a number that is a safe integer.
impl Number
fn parse_float(text: &str) -> f64The
Number.parseFloat()method parses a string argument and returns a floating point number.
impl Number
fn to_fixed(&self, digits: u8) -> Result<JsString, JsValue>The
toFixed()method returns a string representing the Number object using fixed-point notation.
impl Number
fn to_string_with_radix(&self, radix: u8) -> Result<JsString, JsValue>The
toString()method returns a string representing the specified Number object.
Trait Implementations
impl Add for Number
type Output = <&'static Number as Add>::Output;fn add(self, other: Number) -> Self::Output
impl Add<&Number> for Number
type Output = <&'static Number as Add>::Output;fn add(self, other: &Number) -> Self::Output
impl AsRef<JsValue> for Number
fn as_ref(&self) -> &JsValue
impl AsRef<Number> for Number
fn as_ref(&self) -> &Number
impl AsRef<Object> for Number
fn as_ref(&self) -> &Object
impl BitAnd for Number
type Output = <&'static Number as BitAnd>::Output;fn bitand(self, other: Number) -> Self::Output
impl BitAnd<&Number> for Number
type Output = <&'static Number as BitAnd>::Output;fn bitand(self, other: &Number) -> Self::Output
impl BitOr for Number
type Output = <&'static Number as BitOr>::Output;fn bitor(self, other: Number) -> Self::Output
impl BitOr<&Number> for Number
type Output = <&'static Number as BitOr>::Output;fn bitor(self, other: &Number) -> Self::Output
impl BitXor for Number
type Output = <&'static Number as BitXor>::Output;fn bitxor(self, other: Number) -> Self::Output
impl BitXor<&Number> for Number
type Output = <&'static Number as BitXor>::Output;fn bitxor(self, other: &Number) -> Self::Output
impl Clone for Number
fn clone(&self) -> Self
impl Debug for Number
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Default for Number
fn default() -> Self
impl Deref for Number
type Target = Object;fn deref(&self) -> &Object
impl Display for Number
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Div for Number
type Output = <&'static Number as Div>::Output;fn div(self, other: Number) -> Self::Output
impl Div<&Number> for Number
type Output = <&'static Number as Div>::Output;fn div(self, other: &Number) -> Self::Output
impl ErasableGeneric for Number
type Repr = JsValue;
impl From<JsValue> for Number
fn from(obj: JsValue) -> Self
impl From<f32> for Number
fn from(x: f32) -> Number
impl From<f64> for Number
fn from(x: f64) -> Number
impl From<i16> for Number
fn from(x: i16) -> Number
impl From<i32> for Number
fn from(x: i32) -> Number
impl From<i8> for Number
fn from(x: i8) -> Number
impl From<u16> for Number
fn from(x: u16) -> Number
impl From<u32> for Number
fn from(x: u32) -> Number
impl From<u8> for Number
fn from(x: u8) -> Number
impl FromStr for Number
type Err = never;fn from_str(s: &str) -> Result<Self, Self::Err>
impl FromWasmAbi for Number
type Abi = <JsValue as FromWasmAbi>::Abi;unsafe fn from_abi(js: Self::Abi) -> Self
impl IntoJsGeneric for Number
where
Number: JsGeneric,
type JsCanon = Number;fn to_js(self) -> Number
impl IntoWasmAbi for Number
type Abi = <JsValue as IntoWasmAbi>::Abi;fn into_abi(self) -> Self::Abi
impl JsCast for Number
fn instanceof(val: &JsValue) -> boolfn is_type_of(val: &JsValue) -> boolfn unchecked_from_js(val: JsValue) -> Selffn unchecked_from_js_ref(val: &JsValue) -> &Self
impl LongRefFromWasmAbi for Number
type Abi = <JsValue as LongRefFromWasmAbi>::Abi;type Anchor = Number;unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
impl Mul for Number
type Output = <&'static Number as Mul>::Output;fn mul(self, other: Number) -> Self::Output
impl Mul<&Number> for Number
type Output = <&'static Number as Mul>::Output;fn mul(self, other: &Number) -> Self::Output
impl Neg for Number
type Output = <&'static Number as Neg>::Output;fn neg(self) -> Self::Output
impl Not for Number
type Output = <&'static Number as Not>::Output;fn not(self) -> Self::Output
impl OptionFromWasmAbi for Number
fn is_none(abi: &Self::Abi) -> bool
impl OptionIntoWasmAbi for Number
fn none() -> Self::Abi
impl PartialEq for Number
fn eq(&self, other: &Self) -> bool
impl PartialEq<BigInt> for Number
fn eq(&self, other: &BigInt) -> bool
impl PartialEq<f32> for Number
fn eq(&self, other: &f32) -> bool
impl PartialEq<f64> for Number
fn eq(&self, other: &f64) -> bool
impl PartialEq<i16> for Number
fn eq(&self, other: &i16) -> bool
impl PartialEq<i32> for Number
fn eq(&self, other: &i32) -> bool
impl PartialEq<i8> for Number
fn eq(&self, other: &i8) -> bool
impl PartialEq<u16> for Number
fn eq(&self, other: &u16) -> bool
impl PartialEq<u32> for Number
fn eq(&self, other: &u32) -> bool
impl PartialEq<u8> for Number
fn eq(&self, other: &u8) -> bool
impl PartialOrd for Number
fn partial_cmp(&self, other: &Self) -> Option<Ordering>fn lt(&self, other: &Self) -> boolfn le(&self, other: &Self) -> boolfn ge(&self, other: &Self) -> boolfn gt(&self, other: &Self) -> bool
impl Product for Number
fn product<I: Iterator<Item = Self>>(iter: I) -> Self
impl Promising for Number
type Resolution = Number;
impl RefFromWasmAbi for Number
type Abi = <JsValue as RefFromWasmAbi>::Abi;type Anchor = ManuallyDrop<Number>;unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
impl Rem for Number
type Output = <&'static Number as Rem>::Output;fn rem(self, other: Number) -> Self::Output
impl Rem<&Number> for Number
type Output = <&'static Number as Rem>::Output;fn rem(self, other: &Number) -> Self::Output
impl Shl for Number
type Output = <&'static Number as Shl>::Output;fn shl(self, other: Number) -> Self::Output
impl Shl<&Number> for Number
type Output = <&'static Number as Shl>::Output;fn shl(self, other: &Number) -> Self::Output
impl Shr for Number
type Output = <&'static Number as Shr>::Output;fn shr(self, other: Number) -> Self::Output
impl Shr<&Number> for Number
type Output = <&'static Number as Shr>::Output;fn shr(self, other: &Number) -> Self::Output
impl StructuralPartialEq for Number
impl Sub for Number
type Output = <&'static Number as Sub>::Output;fn sub(self, other: Number) -> Self::Output
impl Sub<&Number> for Number
type Output = <&'static Number as Sub>::Output;fn sub(self, other: &Number) -> Self::Output
impl Sum for Number
fn sum<I: Iterator<Item = Self>>(iter: I) -> Self
impl TryFrom<i128> for Number
type Error = TryFromIntError;fn try_from(x: i128) -> Result<Number, Self::Error>
impl TryFrom<i64> for Number
type Error = TryFromIntError;fn try_from(x: i64) -> Result<Number, Self::Error>
impl TryFrom<u128> for Number
type Error = TryFromIntError;fn try_from(x: u128) -> Result<Number, Self::Error>
impl TryFrom<u64> for Number
type Error = TryFromIntError;fn try_from(x: u64) -> Result<Number, Self::Error>
impl UpcastFrom<Number> for Number
impl UpcastFrom<f32> for Number
impl UpcastFrom<f64> for Number
impl UpcastFrom<i16> for Number
impl UpcastFrom<i32> for Number
impl UpcastFrom<i8> for Number
impl UpcastFrom<u16> for Number
impl UpcastFrom<u32> for Number
impl UpcastFrom<u8> for Number
impl WasmDescribe for Number
fn describe()
impl<'a> Product<&'a Number> for Number
fn product<I: Iterator<Item = &'a Self>>(iter: I) -> Self
impl<'a> Sum<&'a Number> for Number
fn sum<I: Iterator<Item = &'a Self>>(iter: I) -> Self