EventEmitter

Struct EventEmitter 

Source
pub struct EventEmitter<'js> {
    pub events: Events<'js>,
}

Fields§

§events: Events<'js>

Implementations§

Source§

impl<'js> EventEmitter<'js>

Source

pub fn new() -> Self

Trait Implementations§

Source§

impl<'js> Clone for EventEmitter<'js>

Source§

fn clone(&self) -> EventEmitter<'js>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'js> ConstructorCreator<'js, EventEmitter<'js>> for ConstructorCreate<EventEmitter<'js>>

Source§

fn create_constructor(&self, ctx: &Ctx<'js>) -> Result<Option<Constructor<'js>>>

Source§

impl<'js> Default for EventEmitter<'js>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'js> Emitter<'js> for EventEmitter<'js>

Source§

fn get_event_list(&self) -> Arc<RwLock<EventList<'js>>>

Source§

fn on_event_changed( &mut self, _event: EventKey<'js>, _added: bool, ) -> Result<()>

Source§

fn add_event_emitter_prototype(ctx: &Ctx<'js>) -> Result<Object<'js>>

Source§

fn trace_event_emitter<'a>(&self, tracer: Tracer<'a, 'js>)

Source§

fn remove_event_listener( this: This<Class<'js, Self>>, ctx: Ctx<'js>, event: Value<'js>, listener: Function<'js>, ) -> Result<Class<'js, Self>>

Source§

fn add_event_listener_str( this: This<Class<'js, Self>>, ctx: &Ctx<'js>, event: &str, listener: Function<'js>, prepend: bool, once: bool, ) -> Result<Class<'js, Self>>

Source§

fn once( this: This<Class<'js, Self>>, ctx: Ctx<'js>, event: Value<'js>, listener: Function<'js>, ) -> Result<Class<'js, Self>>

Source§

fn on( this: This<Class<'js, Self>>, ctx: Ctx<'js>, event: Value<'js>, listener: Function<'js>, ) -> Result<Class<'js, Self>>

Source§

fn prepend_listener( this: This<Class<'js, Self>>, ctx: Ctx<'js>, event: Value<'js>, listener: Function<'js>, ) -> Result<Class<'js, Self>>

Source§

fn prepend_once_listener( this: This<Class<'js, Self>>, ctx: Ctx<'js>, event: Value<'js>, listener: Function<'js>, ) -> Result<Class<'js, Self>>

Source§

fn add_event_listener( this: This<Class<'js, Self>>, ctx: Ctx<'js>, event: Value<'js>, listener: Function<'js>, prepend: bool, once: bool, ) -> Result<Class<'js, Self>>

Source§

fn has_listener_str(&self, event: &str) -> bool

Source§

fn has_listener(&self, ctx: Ctx<'js>, event: Value<'js>) -> Result<bool>

Source§

fn get_listeners( &self, ctx: &Ctx<'js>, event: Value<'js>, ) -> Result<Vec<Function<'js>>>

Source§

fn get_listeners_str(&self, event: &str) -> Vec<Function<'js>>

Source§

fn do_emit( event: Value<'js>, this: This<Class<'js, Self>>, ctx: &Ctx<'js>, args: Rest<Value<'js>>, defer: bool, ) -> Result<()>

Source§

fn emit_str( this: This<Class<'js, Self>>, ctx: &Ctx<'js>, event: &str, args: Vec<Value<'js>>, defer: bool, ) -> Result<()>

Source§

fn emit( this: This<Class<'js, Self>>, ctx: Ctx<'js>, event: Value<'js>, args: Rest<Value<'js>>, ) -> Result<()>

Source§

fn event_names( this: This<OwnedBorrow<'js, Self>>, ctx: Ctx<'js>, ) -> Result<Vec<Value<'js>>>

Source§

impl<'js> FromJs<'js> for EventEmitter<'js>
where for<'a> CloneWrapper<'a, Self>: CloneTrait<Self>,

Source§

fn from_js(ctx: &Ctx<'js>, value: Value<'js>) -> Result<Self>

Source§

impl<'js> IntoJs<'js> for EventEmitter<'js>

Source§

fn into_js(self, ctx: &Ctx<'js>) -> Result<Value<'js>>

Source§

impl<'js> JsClass<'js> for EventEmitter<'js>

Source§

const NAME: &'static str = "EventEmitter"

The name the constructor has in JavaScript
Source§

type Mutable = Writable

Can the type be mutated while a JavaScript value. Read more
Source§

fn class_id() -> &'static ClassId

A unique id for the class.
Source§

fn prototype(ctx: &Ctx<'js>) -> Result<Option<Object<'js>>>

Returns the class prototype,
Source§

fn constructor(ctx: &Ctx<'js>) -> Result<Option<Constructor<'js>>>

Returns a predefined constructor for this specific class type if there is one.
Source§

fn function() -> Option<StaticJsFn>

A possible call function. Read more
Source§

impl<'js> MethodImplementor<EventEmitter<'js>> for MethodImpl<EventEmitter<'js>>

Source§

fn implement(&self, _proto: &Object<'_>) -> Result<()>

Source§

impl<'js> Trace<'js> for EventEmitter<'js>

Source§

fn trace<'a>(&self, tracer: Tracer<'a, 'js>)

Auto Trait Implementations§

§

impl<'js> Freeze for EventEmitter<'js>

§

impl<'js> RefUnwindSafe for EventEmitter<'js>

§

impl<'js> !Send for EventEmitter<'js>

§

impl<'js> !Sync for EventEmitter<'js>

§

impl<'js> Unpin for EventEmitter<'js>

§

impl<'js> UnwindSafe for EventEmitter<'js>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'js, T> AsProperty<'js, T> for T
where T: IntoJs<'js>,

Source§

fn config( self, ctx: &Ctx<'js>, ) -> Result<(i32, Value<'js>, Value<'js>, Value<'js>), Error>

Property configuration Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'js, T> FromParam<'js> for T
where T: FromJs<'js>,

Source§

fn param_requirement() -> ParamRequirement

The parameters requirements this value requires.
Source§

fn from_param<'a>(params: &mut ParamsAccessor<'a, 'js>) -> Result<T, Error>

Convert from a parameter value.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<'js, T> IntoArg<'js> for T
where T: IntoJs<'js>,

Source§

fn num_args(&self) -> usize

The number of arguments this value produces.
Source§

fn into_arg(self, args: &mut Args<'js>) -> Result<(), Error>

Convert the value into an argument.
Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ParallelSend for T