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§
Sourcefn try_placeholder(_: &mut Runtime) -> Option<Self>
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.