BatchableResult

Trait BatchableResult 

Source
pub trait BatchableResult: BinaryDecode {
    // Provided method
    fn try_placeholder(_: &mut Runtime) -> Option<Self> { ... }
}
Expand description

Trait for return types that can be used in batched JS calls. Determines how the type behaves during batching.

Provided Methods§

Source

fn try_placeholder(_: &mut Runtime) -> Option<Self>

Returns Some(placeholder) for opaque types that can be batched, None for types that require flushing to get the actual value.

For opaque types (JsValue, Closure), this reserves a heap ID and returns a placeholder. For trivial types like (), this returns the known value. For value types (primitives, String, Vec, etc.), returns None to trigger a flush.

Default implementation returns None (requires flush).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl BatchableResult for bool

Source§

impl BatchableResult for f32

Source§

impl BatchableResult for f64

Source§

impl BatchableResult for i8

Source§

impl BatchableResult for i16

Source§

impl BatchableResult for i32

Source§

impl BatchableResult for i64

Source§

impl BatchableResult for i128

Source§

impl BatchableResult for isize

Source§

impl BatchableResult for u8

Source§

impl BatchableResult for u16

Source§

impl BatchableResult for u32

Source§

impl BatchableResult for u64

Source§

impl BatchableResult for u128

Source§

impl BatchableResult for ()

Source§

impl BatchableResult for usize

Implementors§