Trait script::dom::bindings::callback::CallbackContainer

source ·
pub trait CallbackContainer {
    // Required methods
    unsafe fn new(cx: JSContext, callback: *mut JSObject) -> Rc<Self>;
    fn callback_holder(&self) -> &CallbackObject;

    // Provided methods
    fn callback(&self) -> *mut JSObject { ... }
    fn incumbent(&self) -> Option<&GlobalScope> { ... }
}
Expand description

A trait to be implemented by concrete IDL callback function and callback interface types.

Required Methods§

source

unsafe fn new(cx: JSContext, callback: *mut JSObject) -> Rc<Self>

Create a new CallbackContainer object for the given JSObject.

source

fn callback_holder(&self) -> &CallbackObject

Returns the underlying CallbackObject.

Provided Methods§

source

fn callback(&self) -> *mut JSObject

Returns the underlying JSObject.

source

fn incumbent(&self) -> Option<&GlobalScope>

Returns the “callback context”, that is, the global to use as incumbent global when calling the callback.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl CallbackContainer for DecodeErrorCallback

source§

impl CallbackContainer for DecodeSuccessCallback

source§

impl CallbackContainer for CustomElementConstructor

source§

impl CallbackContainer for FunctionStringCallback

source§

impl CallbackContainer for EventHandlerNonNull

source§

impl CallbackContainer for OnBeforeUnloadEventHandlerNonNull

source§

impl CallbackContainer for OnErrorEventHandlerNonNull

source§

impl CallbackContainer for EventListener

source§

impl CallbackContainer for Function

source§

impl CallbackContainer for IntersectionObserverCallback

source§

impl CallbackContainer for MediaSessionActionHandler

source§

impl CallbackContainer for MutationCallback

source§

impl CallbackContainer for NodeFilter

source§

impl CallbackContainer for PerformanceObserverCallback

source§

impl CallbackContainer for AnyCallback

source§

impl CallbackContainer for PromiseJobCallback

source§

impl CallbackContainer for QueuingStrategySize

source§

impl CallbackContainer for ResizeObserverCallback

source§

impl CallbackContainer for SimpleCallback

source§

impl CallbackContainer for callbackWithOnlyOneOptionalArg

source§

impl CallbackContainer for UnderlyingSourceCancelCallback

source§

impl CallbackContainer for UnderlyingSourcePullCallback

source§

impl CallbackContainer for UnderlyingSourceStartCallback

source§

impl CallbackContainer for VoidFunction

source§

impl CallbackContainer for FrameRequestCallback

source§

impl CallbackContainer for XPathNSResolver

source§

impl CallbackContainer for XRFrameRequestCallback