Skip to main content

JsBooleanOrStringLike

Trait JsBooleanOrStringLike 

Source
pub trait JsBooleanOrStringLike:
    IntoWasmAbi
    + Sealed
    + JsBigIntOrBooleanOrStringLike
    + JsBooleanOrNumberOrStringLike { }
Expand description

Marker for Rust parameter types represented by the TypeScript union boolean | 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:

  • boolean: bool, Boolean, and &Boolean
  • 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 JsBooleanOrStringLike for &Box<str>

Source§

impl JsBooleanOrStringLike for &Cow<'_, str>

Source§

impl JsBooleanOrStringLike for &String

Source§

impl JsBooleanOrStringLike for &str

Source§

impl JsBooleanOrStringLike for String

Source§

impl JsBooleanOrStringLike for bool

Implementors§