Skip to main content

JsBigIntOrBooleanOrNumberOrStringLike

Trait JsBigIntOrBooleanOrNumberOrStringLike 

Source
pub trait JsBigIntOrBooleanOrNumberOrStringLike: IntoWasmAbi + Sealed { }
Expand description

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

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:

  • bigint: i64, u64, i128, u128, BigInt, and &BigInt
  • boolean: bool, Boolean, and &Boolean
  • number: i8, u8, i16, u16, i32, u32, isize, usize, f32, f64, Number, and &Number
  • string: String, &str, &String, &Box<str>, &Cow<str>, JsString, and &JsString (the JsStringLike types)

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 JsBigIntOrBooleanOrNumberOrStringLike for &Box<str>

Source§

impl JsBigIntOrBooleanOrNumberOrStringLike for &Cow<'_, str>

Source§

impl JsBigIntOrBooleanOrNumberOrStringLike for &String

Source§

impl JsBigIntOrBooleanOrNumberOrStringLike for &str

Source§

impl JsBigIntOrBooleanOrNumberOrStringLike for String

Source§

impl JsBigIntOrBooleanOrNumberOrStringLike for bool

Source§

impl JsBigIntOrBooleanOrNumberOrStringLike for f32

Source§

impl JsBigIntOrBooleanOrNumberOrStringLike for f64

Source§

impl JsBigIntOrBooleanOrNumberOrStringLike for i8

Source§

impl JsBigIntOrBooleanOrNumberOrStringLike for i16

Source§

impl JsBigIntOrBooleanOrNumberOrStringLike for i32

Source§

impl JsBigIntOrBooleanOrNumberOrStringLike for i64

Source§

impl JsBigIntOrBooleanOrNumberOrStringLike for i128

Source§

impl JsBigIntOrBooleanOrNumberOrStringLike for isize

Source§

impl JsBigIntOrBooleanOrNumberOrStringLike for u8

Source§

impl JsBigIntOrBooleanOrNumberOrStringLike for u16

Source§

impl JsBigIntOrBooleanOrNumberOrStringLike for u32

Source§

impl JsBigIntOrBooleanOrNumberOrStringLike for u64

Source§

impl JsBigIntOrBooleanOrNumberOrStringLike for u128

Source§

impl JsBigIntOrBooleanOrNumberOrStringLike for usize

Implementors§