pub trait PromiseHelpers<D: DomTypes> {
type StackRoot: FromJSValConvertible<Config = ()> + ToJSValConvertible + Deref<Target = D::Promise> + StackRootPromiseHelpers<D, HeapTraced = Self::HeapTraced>;
type HeapTraced: Traceable + MallocSizeOf + Deref<Target = D::Promise> + HeapTracedPromiseHelpers<D, StackRoot = Self::StackRoot>;
// Required methods
fn new_in_realm(cx: &mut CurrentRealm<'_>) -> Rc<D::Promise>;
fn new_in_realm_rooted(cx: &mut CurrentRealm<'_>) -> Self::StackRoot;
fn new_rooted(
cx: &mut JSContext,
global: &D::GlobalScope,
) -> Self::StackRoot;
fn reject_error(&self, cx: &mut JSContext, error: Error);
fn is_rejected(&self) -> bool;
fn is_pending(&self) -> bool;
fn is_fulfilled(&self) -> bool;
fn resolve_native<T: ToJSValConvertible>(&self, cx: &mut JSContext, val: &T);
fn reject_native<T: ToJSValConvertible>(&self, cx: &mut JSContext, val: &T);
}Required Associated Types§
type StackRoot: FromJSValConvertible<Config = ()> + ToJSValConvertible + Deref<Target = D::Promise> + StackRootPromiseHelpers<D, HeapTraced = Self::HeapTraced>
type HeapTraced: Traceable + MallocSizeOf + Deref<Target = D::Promise> + HeapTracedPromiseHelpers<D, StackRoot = Self::StackRoot>
Required Methods§
fn new_in_realm(cx: &mut CurrentRealm<'_>) -> Rc<D::Promise>
fn new_in_realm_rooted(cx: &mut CurrentRealm<'_>) -> Self::StackRoot
fn new_rooted(cx: &mut JSContext, global: &D::GlobalScope) -> Self::StackRoot
fn reject_error(&self, cx: &mut JSContext, error: Error)
fn is_rejected(&self) -> bool
fn is_pending(&self) -> bool
fn is_fulfilled(&self) -> bool
fn resolve_native<T: ToJSValConvertible>(&self, cx: &mut JSContext, val: &T)
fn reject_native<T: ToJSValConvertible>(&self, cx: &mut JSContext, val: &T)
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.