Skip to main content

IgnoreEventHandler

Struct IgnoreEventHandler 

Source
pub struct IgnoreEventHandler<F, P: Param> { /* private fields */ }
Expand description

Handler produced by into_handler_event_ignored.

Implements Handler<E> for every E: it fetches its Params, calls the function, and drops the event. It stores no E, so it carries no event lifetime — borrowed / non-'static events (e.g. wire buffers) work.

Trait Implementations§

Source§

impl<E, F: FnMut() + Send + 'static> Handler<E> for IgnoreEventHandler<F, ()>

Source§

fn run(&mut self, _world: &mut World, _event: E)

Run this handler with the given event.
Source§

fn name(&self) -> &'static str

Returns the handler’s name. Read more
Source§

impl<E, F: Send + 'static, P0: Param + 'static> Handler<E> for IgnoreEventHandler<F, (P0,)>
where for<'a> &'a mut F: FnMut(P0) + FnMut(P0::Item<'a>),

Source§

fn run(&mut self, world: &mut World, _event: E)

Run this handler with the given event.
Source§

fn name(&self) -> &'static str

Returns the handler’s name. Read more
Source§

impl<E, F: Send + 'static, P0: Param + 'static, P1: Param + 'static> Handler<E> for IgnoreEventHandler<F, (P0, P1)>
where for<'a> &'a mut F: FnMut(P0, P1) + FnMut(P0::Item<'a>, P1::Item<'a>),

Source§

fn run(&mut self, world: &mut World, _event: E)

Run this handler with the given event.
Source§

fn name(&self) -> &'static str

Returns the handler’s name. Read more
Source§

impl<E, F: Send + 'static, P0: Param + 'static, P1: Param + 'static, P2: Param + 'static> Handler<E> for IgnoreEventHandler<F, (P0, P1, P2)>
where for<'a> &'a mut F: FnMut(P0, P1, P2) + FnMut(P0::Item<'a>, P1::Item<'a>, P2::Item<'a>),

Source§

fn run(&mut self, world: &mut World, _event: E)

Run this handler with the given event.
Source§

fn name(&self) -> &'static str

Returns the handler’s name. Read more
Source§

impl<E, F: Send + 'static, P0: Param + 'static, P1: Param + 'static, P2: Param + 'static, P3: Param + 'static> Handler<E> for IgnoreEventHandler<F, (P0, P1, P2, P3)>
where for<'a> &'a mut F: FnMut(P0, P1, P2, P3) + FnMut(P0::Item<'a>, P1::Item<'a>, P2::Item<'a>, P3::Item<'a>),

Source§

fn run(&mut self, world: &mut World, _event: E)

Run this handler with the given event.
Source§

fn name(&self) -> &'static str

Returns the handler’s name. Read more
Source§

impl<E, F: Send + 'static, P0: Param + 'static, P1: Param + 'static, P2: Param + 'static, P3: Param + 'static, P4: Param + 'static> Handler<E> for IgnoreEventHandler<F, (P0, P1, P2, P3, P4)>
where for<'a> &'a mut F: FnMut(P0, P1, P2, P3, P4) + FnMut(P0::Item<'a>, P1::Item<'a>, P2::Item<'a>, P3::Item<'a>, P4::Item<'a>),

Source§

fn run(&mut self, world: &mut World, _event: E)

Run this handler with the given event.
Source§

fn name(&self) -> &'static str

Returns the handler’s name. Read more
Source§

impl<E, F: Send + 'static, P0: Param + 'static, P1: Param + 'static, P2: Param + 'static, P3: Param + 'static, P4: Param + 'static, P5: Param + 'static> Handler<E> for IgnoreEventHandler<F, (P0, P1, P2, P3, P4, P5)>
where for<'a> &'a mut F: FnMut(P0, P1, P2, P3, P4, P5) + FnMut(P0::Item<'a>, P1::Item<'a>, P2::Item<'a>, P3::Item<'a>, P4::Item<'a>, P5::Item<'a>),

Source§

fn run(&mut self, world: &mut World, _event: E)

Run this handler with the given event.
Source§

fn name(&self) -> &'static str

Returns the handler’s name. Read more
Source§

impl<E, F: Send + 'static, P0: Param + 'static, P1: Param + 'static, P2: Param + 'static, P3: Param + 'static, P4: Param + 'static, P5: Param + 'static, P6: Param + 'static> Handler<E> for IgnoreEventHandler<F, (P0, P1, P2, P3, P4, P5, P6)>
where for<'a> &'a mut F: FnMut(P0, P1, P2, P3, P4, P5, P6) + FnMut(P0::Item<'a>, P1::Item<'a>, P2::Item<'a>, P3::Item<'a>, P4::Item<'a>, P5::Item<'a>, P6::Item<'a>),

Source§

fn run(&mut self, world: &mut World, _event: E)

Run this handler with the given event.
Source§

fn name(&self) -> &'static str

Returns the handler’s name. Read more
Source§

impl<E, F: Send + 'static, P0: Param + 'static, P1: Param + 'static, P2: Param + 'static, P3: Param + 'static, P4: Param + 'static, P5: Param + 'static, P6: Param + 'static, P7: Param + 'static> Handler<E> for IgnoreEventHandler<F, (P0, P1, P2, P3, P4, P5, P6, P7)>
where for<'a> &'a mut F: FnMut(P0, P1, P2, P3, P4, P5, P6, P7) + FnMut(P0::Item<'a>, P1::Item<'a>, P2::Item<'a>, P3::Item<'a>, P4::Item<'a>, P5::Item<'a>, P6::Item<'a>, P7::Item<'a>),

Source§

fn run(&mut self, world: &mut World, _event: E)

Run this handler with the given event.
Source§

fn name(&self) -> &'static str

Returns the handler’s name. Read more

Auto Trait Implementations§

§

impl<F, P> Freeze for IgnoreEventHandler<F, P>
where F: Freeze, <P as Param>::State: Freeze,

§

impl<F, P> RefUnwindSafe for IgnoreEventHandler<F, P>

§

impl<F, P> Send for IgnoreEventHandler<F, P>
where F: Send, <P as Param>::State: Send,

§

impl<F, P> Sync for IgnoreEventHandler<F, P>
where F: Sync, <P as Param>::State: Sync,

§

impl<F, P> Unpin for IgnoreEventHandler<F, P>
where F: Unpin, <P as Param>::State: Unpin,

§

impl<F, P> UnsafeUnpin for IgnoreEventHandler<F, P>
where F: UnsafeUnpin, <P as Param>::State: UnsafeUnpin,

§

impl<F, P> UnwindSafe for IgnoreEventHandler<F, P>
where F: UnwindSafe, <P as Param>::State: UnwindSafe,

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<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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<E, H> IntoHandler<E, Resolved> for H
where H: Handler<E> + 'static,

Source§

type Handler = H

The concrete handler type produced.
Source§

fn into_handler(self, _registry: &Registry) -> H

Convert this function into a handler, resolving parameters from the registry.
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.