pub struct CallbackObject<D: DomTypes> {
callback: Heap<*mut JSObject>,
incumbent: Option<Dom<D::GlobalScope>>,
}Expand description
A common base class for representing IDL callback function and callback interface types.
Fields§
§callback: Heap<*mut JSObject>The underlying JSObject.
incumbent: Option<Dom<D::GlobalScope>>The “callback context”, that is, the global to use as incumbent global when calling the callback.
Looking at the WebIDL standard, it appears as though there would always be a value here, but sometimes callback functions are created by hand-waving without defining the value of the callback context, and without any JavaScript code on the stack to grab an incumbent global from.
Implementations§
Source§impl<D: DomTypes> CallbackObject<D>
impl<D: DomTypes> CallbackObject<D>
fn new_from_existing(other: &CallbackObject<D>) -> Self
fn new_with_exterior_root() -> Self
pub fn get(&self) -> *mut JSObject
unsafe fn init_callback(&mut self, callback: *mut JSObject)
Trait Implementations§
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for BlobCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for BlobCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for CallbackFunction<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for CallbackFunction<D>
Source§fn from(object: &'a CallbackObject<D>) -> Self
fn from(object: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for CallbackInterface<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for CallbackInterface<D>
Source§fn from(object: &'a CallbackObject<D>) -> Self
fn from(object: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for CreateHTMLCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for CreateHTMLCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for CreateScriptCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for CreateScriptCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for CreateScriptURLCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for CreateScriptURLCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for CustomElementConstructor<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for CustomElementConstructor<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for DecodeErrorCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for DecodeErrorCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for DecodeSuccessCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for DecodeSuccessCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for ErrorCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for ErrorCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for EventHandlerNonNull<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for EventHandlerNonNull<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for EventListener<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for EventListener<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for FileCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for FileCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for FileSystemEntriesCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for FileSystemEntriesCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for FileSystemEntryCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for FileSystemEntryCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for FrameRequestCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for FrameRequestCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for Function<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for Function<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for FunctionStringCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for FunctionStringCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for IntersectionObserverCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for IntersectionObserverCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for MediaSessionActionHandler<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for MediaSessionActionHandler<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for MutationCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for MutationCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for NodeFilter<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for NodeFilter<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for NotificationPermissionCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for NotificationPermissionCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for OnBeforeUnloadEventHandlerNonNull<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for OnBeforeUnloadEventHandlerNonNull<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for OnErrorEventHandlerNonNull<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for OnErrorEventHandlerNonNull<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for PerformanceObserverCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for PerformanceObserverCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for PositionCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for PositionCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for PositionErrorCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for PositionErrorCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for QueuingStrategySize<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for QueuingStrategySize<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for ReportingObserverCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for ReportingObserverCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for ResizeObserverCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for ResizeObserverCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for SimpleCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for SimpleCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for TransformerCancelCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for TransformerCancelCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for TransformerFlushCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for TransformerFlushCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for TransformerStartCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for TransformerStartCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for TransformerTransformCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for TransformerTransformCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for UnderlyingSinkAbortCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for UnderlyingSinkAbortCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for UnderlyingSinkCloseCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for UnderlyingSinkCloseCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for UnderlyingSinkStartCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for UnderlyingSinkStartCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for UnderlyingSinkWriteCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for UnderlyingSinkWriteCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for UnderlyingSourceCancelCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for UnderlyingSourceCancelCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for UnderlyingSourcePullCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for UnderlyingSourcePullCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for UnderlyingSourceStartCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for UnderlyingSourceStartCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for VoidFunction<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for VoidFunction<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for XPathNSResolver<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for XPathNSResolver<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for XRFrameRequestCallback<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for XRFrameRequestCallback<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for callbackWithOnlyOneOptionalArg<D>
impl<'a, D: DomTypes> From<&'a CallbackObject<D>> for callbackWithOnlyOneOptionalArg<D>
Source§fn from(base: &'a CallbackObject<D>) -> Self
fn from(base: &'a CallbackObject<D>) -> Self
Converts to this type from the input type.
Source§impl<D> MallocSizeOf for CallbackObject<D>where
D: MallocSizeOf + DomTypes,
impl<D> MallocSizeOf for CallbackObject<D>where
D: MallocSizeOf + DomTypes,
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
Source§impl<D: DomTypes> PartialEq for CallbackObject<D>
impl<D: DomTypes> PartialEq for CallbackObject<D>
Source§fn eq(&self, other: &CallbackObject<D>) -> bool
fn eq(&self, other: &CallbackObject<D>) -> bool
Tests for
self and other values to be equal, and is used by ==.Auto Trait Implementations§
impl<D> !Freeze for CallbackObject<D>
impl<D> !RefUnwindSafe for CallbackObject<D>
impl<D> !Send for CallbackObject<D>
impl<D> !Sync for CallbackObject<D>
impl<D> Unpin for CallbackObject<D>
impl<D> UnsafeUnpin for CallbackObject<D>
impl<D> UnwindSafe for CallbackObject<D>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert