Struct Number

#[repr(transparent)]
pub struct Number { /* private fields */ }

Implementations

impl Number

fn is_integer(value: &JsValue) -> bool

The Number.isInteger() method determines whether the passed value is an integer.

MDN documentation

impl Number

fn new(value: &JsValue) -> Number

The Number JavaScript object is a wrapper object allowing you to work with numerical values. A Number object is created using the Number() constructor.

MDN documentation

impl Number

fn to_locale_string(&self, locale: &str) -> JsString

The toLocaleString() method returns a string with a language sensitive representation of this number.

MDN documentation

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.

MDN documentation

impl Number

fn value_of(&self) -> f64

The valueOf() method returns the wrapped primitive value of a Number object.

MDN documentation

impl Number

fn is_nan(value: &JsValue) -> bool

The Number.isNaN() method determines whether the passed value is NaN and its type is Number. It is a more robust version of the original, global isNaN().

MDN documentation

impl Number

fn parse_int(text: &str, radix: u8) -> f64

The Number.parseInt() method parses a string argument and returns an integer of the specified radix or base.

MDN documentation

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.

MDN documentation

impl Number

fn to_string(&self, radix: u8) -> Result<JsString, JsValue>

The toString() method returns a string representing the specified Number object.

MDN documentation

impl Number

const EPSILON: f64 = f64::EPSILON;

The smallest interval between two representable numbers.

MDN Documentation

const MAX_SAFE_INTEGER: f64 = 9007199254740991.0;

The maximum safe integer in JavaScript (2^53 - 1).

MDN Documentation

const MAX_VALUE: f64 = f64::MAX;

The largest positive representable number.

MDN Documentation

const MIN_SAFE_INTEGER: f64 = -9007199254740991.0;

The minimum safe integer in JavaScript (-(2^53 - 1)).

MDN Documentation

const MIN_VALUE: f64 = 5E-324;

The smallest positive representable number—that is, the positive number closest to zero (without actually being zero).

MDN Documentation

const NAN: f64 = f64::NAN;

Special "Not a Number" value.

MDN Documentation

const NEGATIVE_INFINITY: f64 = f64::NEG_INFINITY;

Special value representing negative infinity. Returned on overflow.

MDN Documentation

const POSITIVE_INFINITY: f64 = f64::INFINITY;

Special value representing infinity. Returned on overflow.

MDN Documentation

fn pow(&self, rhs: &Self) -> Self

Applies the binary ** JS operator on the two Numbers.

MDN documentation

fn unsigned_shr(&self, rhs: &Self) -> Self

Applies the binary >>> JS operator on the two Numbers.

MDN documentation

impl Number

fn is_finite(value: &JsValue) -> bool

The Number.isFinite() method determines whether the passed value is a finite number.

MDN documentation

impl Number

fn is_safe_integer(value: &JsValue) -> bool

The Number.isSafeInteger() method determines whether the provided value is a number that is a safe integer.

MDN documentation

impl Number

fn parse_float(text: &str) -> f64

The Number.parseFloat() method parses a string argument and returns a floating point number.

MDN documentation

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.

MDN documentation

impl Number

fn to_string_with_radix(&self, radix: u8) -> Result<JsString, JsValue>

The toString() method returns a string representing the specified Number object.

MDN documentation

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) -> bool
fn is_type_of(val: &JsValue) -> bool
fn unchecked_from_js(val: JsValue) -> Self
fn 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) -> bool
fn le(&self, other: &Self) -> bool
fn ge(&self, other: &Self) -> bool
fn 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

Auto Trait Implementations

impl Freeze for Number

impl RefUnwindSafe for Number

impl Send for Number

impl Sync for Number

impl Unpin for Number

impl UnsafeUnpin for Number

impl UnwindSafe for Number

Blanket Implementations

impl<P, T> Receiver for Number where P: Deref<Target = T> + ?Sized, T: ?Sized,

impl<S, T> Upcast<T> for Number where T: UpcastFrom<S> + ?Sized, S: ?Sized,

impl<T> Any for Number where T: 'static + ?Sized,

impl<T> Borrow<T> for Number where T: ?Sized,

impl<T> BorrowMut<T> for Number where T: ?Sized,

impl<T> CloneToUninit for Number where T: Clone,

impl<T> From<T> for Number

impl<T> JsGeneric for Number where T: ErasableGeneric<Repr = JsValue> + UpcastFrom<T> + Upcast<JsValue> + JsCast + 'static,

impl<T> ReturnWasmAbi for Number where T: IntoWasmAbi,

impl<T> ToOwned for Number where T: Clone,

impl<T> ToString for Number where T: Display + ?Sized,

impl<T> TryFromJsValue for Number where T: JsCast,

impl<T> VectorFromWasmAbi for Number where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorIntoWasmAbi for Number where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorRefIntoWasmAbi for Number where &'a T: for<'a> Into<JsValue>,

impl<T, U> Into<U> for Number where U: From<T>,

impl<T, U> TryFrom<U> for Number where U: Into<T>,

impl<T, U> TryInto<U> for Number where U: TryFrom<T>,