pub struct EventTarget<'js> {
pub events: Events<'js>,
}Fields§
§events: Events<'js>Implementations§
Source§impl<'js> EventTarget<'js>
impl<'js> EventTarget<'js>
Trait Implementations§
Source§impl<'js> Clone for EventTarget<'js>
impl<'js> Clone for EventTarget<'js>
Source§fn clone(&self) -> EventTarget<'js>
fn clone(&self) -> EventTarget<'js>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'js> ConstructorCreator<'js, EventTarget<'js>> for ConstructorCreate<EventTarget<'js>>
impl<'js> ConstructorCreator<'js, EventTarget<'js>> for ConstructorCreate<EventTarget<'js>>
fn create_constructor(&self, ctx: &Ctx<'js>) -> Result<Option<Constructor<'js>>>
Source§impl<'js> Emitter<'js> for EventTarget<'js>
impl<'js> Emitter<'js> for EventTarget<'js>
fn get_event_list(&self) -> Arc<RwLock<EventList<'js>>> ⓘ
fn on_event_changed( &mut self, _event: EventKey<'js>, _added: bool, ) -> Result<()>
Source§fn resolve_events_from(
ctx: &Ctx<'js>,
this: &Object<'js>,
) -> Result<Events<'js>>
fn resolve_events_from( ctx: &Ctx<'js>, this: &Object<'js>, ) -> Result<Events<'js>>
Resolve the event list from a
this object. For native classes,
extracts from the class data. For plain JS objects, uses the hidden property.fn add_event_emitter_prototype(ctx: &Ctx<'js>) -> Result<Object<'js>>
fn add_event_target_prototype(ctx: &Ctx<'js>) -> Result<Object<'js>>
fn trace_event_emitter<'a>(&self, tracer: Tracer<'a, 'js>)
fn remove_event_listener_str( this: Class<'js, Self>, ctx: &Ctx<'js>, event: &str, listener: Function<'js>, ) -> Result<Object<'js>>
fn remove_event_listener( this: This<Object<'js>>, ctx: Ctx<'js>, event: Value<'js>, listener: Function<'js>, ) -> Result<Object<'js>>
fn add_event_listener_str( this: Class<'js, Self>, ctx: &Ctx<'js>, event: &str, listener: Function<'js>, prepend: bool, once: bool, ) -> Result<Object<'js>>
fn once( this: This<Object<'js>>, ctx: Ctx<'js>, event: Value<'js>, listener: Function<'js>, ) -> Result<Object<'js>>
fn on( this: This<Object<'js>>, ctx: Ctx<'js>, event: Value<'js>, listener: Function<'js>, ) -> Result<Object<'js>>
fn prepend_listener( this: This<Object<'js>>, ctx: Ctx<'js>, event: Value<'js>, listener: Function<'js>, ) -> Result<Object<'js>>
fn prepend_once_listener( this: This<Object<'js>>, ctx: Ctx<'js>, event: Value<'js>, listener: Function<'js>, ) -> Result<Object<'js>>
fn evt_add_event_listener( this: This<Object<'js>>, ctx: Ctx<'js>, event: Value<'js>, listener: Function<'js>, options: Opt<Object<'js>>, ) -> Result<Object<'js>>
fn add_event_listener( this: This<Object<'js>>, ctx: Ctx<'js>, event: Value<'js>, listener: Function<'js>, prepend: bool, once: bool, ) -> Result<Object<'js>>
fn has_listener_str(&self, event: &str) -> bool
fn has_listener(&self, ctx: Ctx<'js>, event: Value<'js>) -> Result<bool>
fn get_listeners( &self, ctx: &Ctx<'js>, event: Value<'js>, ) -> Result<Vec<Function<'js>>>
fn get_listeners_str(&self, event: &str) -> Vec<Function<'js>>
fn do_emit( event: Value<'js>, this: This<Object<'js>>, ctx: &Ctx<'js>, args: Rest<Value<'js>>, defer: bool, ) -> Result<bool>
fn emit_str( this: Class<'js, Self>, ctx: &Ctx<'js>, event: &str, args: Vec<Value<'js>>, defer: bool, ) -> Result<()>
fn emit( this: This<Object<'js>>, ctx: Ctx<'js>, event: Value<'js>, args: Rest<Value<'js>>, ) -> Result<bool>
fn evt_dispatch_event( this: This<Object<'js>>, ctx: Ctx<'js>, event: Value<'js>, ) -> Result<bool>
fn event_names( this: This<Object<'js>>, ctx: Ctx<'js>, ) -> Result<Vec<Value<'js>>>
fn listener_count( this: This<Object<'js>>, ctx: Ctx<'js>, event: Value<'js>, ) -> Result<usize>
fn remove_all_listeners( this: This<Object<'js>>, ctx: Ctx<'js>, event: Opt<Value<'js>>, ) -> Result<Object<'js>>
Source§impl<'js> FromJs<'js> for EventTarget<'js>where
for<'a> CloneWrapper<'a, Self>: CloneTrait<Self>,
impl<'js> FromJs<'js> for EventTarget<'js>where
for<'a> CloneWrapper<'a, Self>: CloneTrait<Self>,
Source§impl<'js> IntoJs<'js> for EventTarget<'js>
impl<'js> IntoJs<'js> for EventTarget<'js>
Source§impl<'js> JsClass<'js> for EventTarget<'js>
impl<'js> JsClass<'js> for EventTarget<'js>
Source§fn constructor(ctx: &Ctx<'js>) -> Result<Option<Constructor<'js>>>
fn constructor(ctx: &Ctx<'js>) -> Result<Option<Constructor<'js>>>
Returns a predefined constructor for this specific class type if there is one.
Source§fn call<'a>(
this: &JsCell<'js, Self>,
params: Params<'a, 'js>,
) -> Result<Value<'js>, Error>
fn call<'a>( this: &JsCell<'js, Self>, params: Params<'a, 'js>, ) -> Result<Value<'js>, Error>
The function which will be called if
Self::KIND is ClassKind::Callable and an object with this
class is called as if it is a function.Source§fn exotic_get_property(
this: &JsCell<'js, Self>,
ctx: &Ctx<'js>,
_atom: Atom<'js>,
_receiver: Value<'js>,
) -> Result<Value<'js>, Error>
fn exotic_get_property( this: &JsCell<'js, Self>, ctx: &Ctx<'js>, _atom: Atom<'js>, _receiver: Value<'js>, ) -> Result<Value<'js>, Error>
The function which will be called if a get property is performed on an object with this class
Source§fn exotic_set_property(
this: &JsCell<'js, Self>,
_ctx: &Ctx<'js>,
_atom: Atom<'js>,
_receiver: Value<'js>,
_value: Value<'js>,
) -> Result<bool, Error>
fn exotic_set_property( this: &JsCell<'js, Self>, _ctx: &Ctx<'js>, _atom: Atom<'js>, _receiver: Value<'js>, _value: Value<'js>, ) -> Result<bool, Error>
The function which will be called if a set property is performed on an object with this class
Source§fn exotic_delete_property(
this: &JsCell<'js, Self>,
_ctx: &Ctx<'js>,
_atom: Atom<'js>,
) -> Result<bool, Error>
fn exotic_delete_property( this: &JsCell<'js, Self>, _ctx: &Ctx<'js>, _atom: Atom<'js>, ) -> Result<bool, Error>
The function which will be called if a delete property is performed on an object with this class
Source§fn exotic_has_property(
this: &JsCell<'js, Self>,
_ctx: &Ctx<'js>,
_atom: Atom<'js>,
) -> Result<bool, Error>
fn exotic_has_property( this: &JsCell<'js, Self>, _ctx: &Ctx<'js>, _atom: Atom<'js>, ) -> Result<bool, Error>
The function which will be called if has property or similar is called on an object with this class
Source§fn exotic_get_own_property(
this: &JsCell<'js, Self>,
_ctx: &Ctx<'js>,
_atom: Atom<'js>,
) -> Result<Option<PropertyDescriptor<'js>>, Error>
fn exotic_get_own_property( this: &JsCell<'js, Self>, _ctx: &Ctx<'js>, _atom: Atom<'js>, ) -> Result<Option<PropertyDescriptor<'js>>, Error>
Called to get the own property descriptor for a given property name. Read more
Source§fn exotic_get_own_property_names(
this: &JsCell<'js, Self>,
_ctx: &Ctx<'js>,
) -> Result<Vec<PropertyName<'js>>, Error>
fn exotic_get_own_property_names( this: &JsCell<'js, Self>, _ctx: &Ctx<'js>, ) -> Result<Vec<PropertyName<'js>>, Error>
Called to enumerate the own property names of this object. Read more
Source§impl<'js> JsLifetime<'js> for EventTarget<'js>
impl<'js> JsLifetime<'js> for EventTarget<'js>
Source§type Changed<'to> = EventTarget<'to>
type Changed<'to> = EventTarget<'to>
The target which has the same type as a
Self but with another lifetime 'tSource§impl<'js> MethodImplementor<EventTarget<'js>> for MethodImpl<EventTarget<'js>>
impl<'js> MethodImplementor<EventTarget<'js>> for MethodImpl<EventTarget<'js>>
Auto Trait Implementations§
impl<'js> !Send for EventTarget<'js>
impl<'js> !Sync for EventTarget<'js>
impl<'js> Freeze for EventTarget<'js>
impl<'js> RefUnwindSafe for EventTarget<'js>
impl<'js> Unpin for EventTarget<'js>
impl<'js> UnsafeUnpin for EventTarget<'js>
impl<'js> UnwindSafe for EventTarget<'js>
Blanket Implementations§
Source§impl<'js, T> AsProperty<'js, T> for Twhere
T: IntoJs<'js>,
impl<'js, T> AsProperty<'js, T> for Twhere
T: IntoJs<'js>,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'js, T> FromParam<'js> for Twhere
T: FromJs<'js>,
impl<'js, T> FromParam<'js> for Twhere
T: FromJs<'js>,
Source§fn param_requirement() -> ParamRequirement
fn param_requirement() -> ParamRequirement
The parameters requirements this value requires.
Source§fn from_param<'a>(params: &mut ParamsAccessor<'a, 'js>) -> Result<T, Error>
fn from_param<'a>(params: &mut ParamsAccessor<'a, 'js>) -> Result<T, Error>
Convert from a parameter value.
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 more