Skip to main content

JsBooleanOrNumberLike

Trait JsBooleanOrNumberLike 

Source
pub trait JsBooleanOrNumberLike:
    IntoWasmAbi
    + Sealed
    + JsBigIntOrBooleanOrNumberLike
    + JsBooleanOrNumberOrStringLike { }
Expand description

Marker for Rust parameter types represented by the TypeScript union boolean | number.

Use this trait as a bound on an experimental_generic_mono JavaScript import. Each monomorphisation retains its concrete ABI representation; this marker only restricts which Rust types may instantiate the parameter.

The union’s primitive categories use these Rust representations:

  • boolean: bool, Boolean, and &Boolean
  • number: i8, u8, i16, u16, i32, u32, isize, usize, f32, f64, Number, and &Number

This trait is experimental and may change or be removed as experimental_generic_mono evolves.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl JsBooleanOrNumberLike for bool

Source§

impl JsBooleanOrNumberLike for f32

Source§

impl JsBooleanOrNumberLike for f64

Source§

impl JsBooleanOrNumberLike for i8

Source§

impl JsBooleanOrNumberLike for i16

Source§

impl JsBooleanOrNumberLike for i32

Source§

impl JsBooleanOrNumberLike for isize

Source§

impl JsBooleanOrNumberLike for u8

Source§

impl JsBooleanOrNumberLike for u16

Source§

impl JsBooleanOrNumberLike for u32

Source§

impl JsBooleanOrNumberLike for usize

Implementors§