Struct script::dom::messageevent::MessageEvent
source · #[repr(C)]pub struct MessageEvent {
event: Event,
data: Heap<JSVal>,
origin: DomRefCell<DOMString>,
source: DomRefCell<Option<SrcObject>>,
lastEventId: DomRefCell<DOMString>,
ports: DomRefCell<Vec<Dom<MessagePort>>>,
frozen_ports: CachedFrozenArray,
}
Fields§
§event: Event
§data: Heap<JSVal>
§origin: DomRefCell<DOMString>
§source: DomRefCell<Option<SrcObject>>
§lastEventId: DomRefCell<DOMString>
§ports: DomRefCell<Vec<Dom<MessagePort>>>
§frozen_ports: CachedFrozenArray
Implementations§
source§impl MessageEvent
impl MessageEvent
fn __assert_parent_type(&self)
source§impl MessageEvent
impl MessageEvent
pub fn new_inherited( origin: DOMString, source: Option<&WindowProxyOrMessagePortOrServiceWorker>, lastEventId: DOMString, ports: Vec<Root<Dom<MessagePort>>>, ) -> MessageEvent
pub fn new_uninitialized( global: &GlobalScope, can_gc: CanGc, ) -> Root<Dom<MessageEvent>>
fn new_uninitialized_with_proto( global: &GlobalScope, proto: Option<HandleObject<'_>>, can_gc: CanGc, ) -> Root<Dom<MessageEvent>>
fn new_initialized( global: &GlobalScope, proto: Option<HandleObject<'_>>, data: HandleValue<'_>, origin: DOMString, source: Option<&WindowProxyOrMessagePortOrServiceWorker>, lastEventId: DOMString, ports: Vec<Root<Dom<MessagePort>>>, can_gc: CanGc, ) -> Root<Dom<MessageEvent>>
pub fn new( global: &GlobalScope, type_: Atom, bubbles: bool, cancelable: bool, data: HandleValue<'_>, origin: DOMString, source: Option<&WindowProxyOrMessagePortOrServiceWorker>, lastEventId: DOMString, ports: Vec<Root<Dom<MessagePort>>>, can_gc: CanGc, ) -> Root<Dom<MessageEvent>>
fn new_with_proto( global: &GlobalScope, proto: Option<HandleObject<'_>>, type_: Atom, bubbles: bool, cancelable: bool, data: HandleValue<'_>, origin: DOMString, source: Option<&WindowProxyOrMessagePortOrServiceWorker>, lastEventId: DOMString, ports: Vec<Root<Dom<MessagePort>>>, can_gc: CanGc, ) -> Root<Dom<MessageEvent>>
pub fn dispatch_jsval( target: &EventTarget, scope: &GlobalScope, message: HandleValue<'_>, origin: Option<&str>, source: Option<&WindowProxy>, ports: Vec<Root<Dom<MessagePort>>>, can_gc: CanGc, )
pub fn dispatch_error(target: &EventTarget, scope: &GlobalScope, can_gc: CanGc)
Trait Implementations§
source§impl Castable for MessageEvent
impl Castable for MessageEvent
source§impl DomObject for MessageEvent
impl DomObject for MessageEvent
source§impl DomObjectWrap for MessageEvent
impl DomObjectWrap for MessageEvent
source§const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::MessageEventBinding::MessageEvent_Binding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::messageevent::MessageEvent>, script_runtime::CanGc) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::messageevent::MessageEvent>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>, _: CanGc) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::MessageEventBinding::MessageEvent_Binding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::messageevent::MessageEvent>, script_runtime::CanGc) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::messageevent::MessageEvent>>}
Function pointer to the general wrap function type
source§impl HasParent for MessageEvent
impl HasParent for MessageEvent
source§impl IDLInterface for MessageEvent
impl IDLInterface for MessageEvent
source§impl MallocSizeOf for MessageEvent
impl MallocSizeOf for MessageEvent
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 MessageEventMethods for MessageEvent
impl MessageEventMethods for MessageEvent
source§fn Constructor(
global: &GlobalScope,
proto: Option<HandleObject<'_>>,
can_gc: CanGc,
type_: DOMString,
init: RootedTraceableBox<MessageEventInit>,
) -> Result<Root<Dom<MessageEvent>>, Error>
fn Constructor( global: &GlobalScope, proto: Option<HandleObject<'_>>, can_gc: CanGc, type_: DOMString, init: RootedTraceableBox<MessageEventInit>, ) -> Result<Root<Dom<MessageEvent>>, Error>
source§fn Data(&self, _cx: JSContext, retval: MutableHandleValue<'_>)
fn Data(&self, _cx: JSContext, retval: MutableHandleValue<'_>)
source§fn LastEventId(&self) -> DOMString
fn LastEventId(&self) -> DOMString
source§fn Ports(&self, cx: JSContext, retval: MutableHandleValue<'_>)
fn Ports(&self, cx: JSContext, retval: MutableHandleValue<'_>)
source§fn InitMessageEvent(
&self,
_cx: JSContext,
type_: DOMString,
bubbles: bool,
cancelable: bool,
data: HandleValue<'_>,
origin: DOMString,
lastEventId: DOMString,
source: Option<WindowProxyOrMessagePortOrServiceWorker>,
ports: Vec<Root<Dom<MessagePort>>>,
)
fn InitMessageEvent( &self, _cx: JSContext, type_: DOMString, bubbles: bool, cancelable: bool, data: HandleValue<'_>, origin: DOMString, lastEventId: DOMString, source: Option<WindowProxyOrMessagePortOrServiceWorker>, ports: Vec<Root<Dom<MessagePort>>>, )
fn GetSource(&self) -> Option<WindowProxyOrMessagePortOrServiceWorker>
source§impl MutDomObject for MessageEvent
impl MutDomObject for MessageEvent
source§impl PartialEq for MessageEvent
impl PartialEq for MessageEvent
source§impl ToJSValConvertible for MessageEvent
impl ToJSValConvertible for MessageEvent
source§impl Traceable for MessageEvent
impl Traceable for MessageEvent
impl DerivedFrom<Event> for MessageEvent
impl Eq for MessageEvent
Auto Trait Implementations§
impl !Freeze for MessageEvent
impl !RefUnwindSafe for MessageEvent
impl !Send for MessageEvent
impl !Sync for MessageEvent
impl Unpin for MessageEvent
impl !UnwindSafe for MessageEvent
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. 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