[][src]Struct event_listener_primitives::Bag

pub struct Bag { /* fields omitted */ }

Data structure that holds Fn() event handlers

Implementations

impl Bag[src]

pub fn add<F>(&self, callback: F) -> HandlerId where
    F: Fn() + Send + Sync + 'static, 
[src]

Add new event handler to a bag

pub fn add_boxed_arc(
    &self,
    callback: Arc<Box<dyn Fn() + Send + Sync + 'static>>
) -> HandlerId
[src]

Add new event handler to a bag that is already Arc<Box<Fn()>>

pub fn call<A>(&self, applicator: A) where
    A: Fn(&Box<dyn Fn() + Send + Sync + 'static>), 
[src]

Call applicator with each handler and keep handlers in the bag

pub fn call_simple(&self)[src]

Call each handler without arguments and keep handlers in the bag

Trait Implementations

impl Clone for Bag[src]

impl Default for Bag[src]

Auto Trait Implementations

impl !RefUnwindSafe for Bag[src]

impl Send for Bag[src]

impl Sync for Bag[src]

impl Unpin for Bag[src]

impl !UnwindSafe for Bag[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.