script::dom::bindings::callback

Trait CallbackContainer

Source
pub trait CallbackContainer<D>
where D: DomTypes,
{ // Required methods unsafe fn new(cx: JSContext, callback: *mut JSObject) -> Rc<Self>; fn callback_holder(&self) -> &CallbackObject<D>; // Provided methods fn callback(&self) -> *mut JSObject { ... } fn incumbent(&self) -> Option<&<D as DomTypes>::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.

§Safety

callback must point to a valid, non-null JSObject.

Source

fn callback_holder(&self) -> &CallbackObject<D>

Returns the underlying CallbackObject.

Provided Methods§

Source

fn callback(&self) -> *mut JSObject

Returns the underlying JSObject.

Source

fn incumbent(&self) -> Option<&<D as DomTypes>::GlobalScope>

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

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§

Source§

impl<D> CallbackContainer<D> for DecodeErrorCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for DecodeSuccessCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for CustomElementConstructor<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for FunctionStringCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for EventHandlerNonNull<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for OnBeforeUnloadEventHandlerNonNull<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for OnErrorEventHandlerNonNull<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for EventListener<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for Function<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for BlobCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for IntersectionObserverCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for MediaSessionActionHandler<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for MutationCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for NodeFilter<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for NotificationPermissionCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for PerformanceObserverCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for AnyCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for PromiseJobCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for QueuingStrategySize<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for ReportingObserverCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for ResizeObserverCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for SimpleCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for callbackWithOnlyOneOptionalArg<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for TransformerCancelCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for TransformerFlushCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for TransformerStartCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for TransformerTransformCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for CreateHTMLCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for CreateScriptCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for CreateScriptURLCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for UnderlyingSinkAbortCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for UnderlyingSinkCloseCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for UnderlyingSinkStartCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for UnderlyingSinkWriteCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for UnderlyingSourceCancelCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for UnderlyingSourcePullCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for UnderlyingSourceStartCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for VoidFunction<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for FrameRequestCallback<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for XPathNSResolver<D>
where D: DomTypes,

Source§

impl<D> CallbackContainer<D> for XRFrameRequestCallback<D>
where D: DomTypes,