Skip to main content

PromiseHelpers

Trait PromiseHelpers 

Source
pub trait PromiseHelpers<D: DomTypes> {
    // Required methods
    fn new_in_realm(cx: &mut CurrentRealm<'_>) -> Rc<D::Promise>;
    fn reject_error(&self, cx: &mut JSContext, error: Error);
    fn is_rejected(&self) -> bool;
    fn is_pending(&self) -> bool;
    fn resolve_native<T: ToJSValConvertible>(&self, cx: &mut JSContext, val: &T);
}

Required Methods§

Source

fn new_in_realm(cx: &mut CurrentRealm<'_>) -> Rc<D::Promise>

Source

fn reject_error(&self, cx: &mut JSContext, error: Error)

Source

fn is_rejected(&self) -> bool

Source

fn is_pending(&self) -> bool

Source

fn resolve_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.

Implementors§