[][src]Struct orbtk_api::event::EventBox

pub struct EventBox {
    pub source: Entity,
    pub strategy: EventStrategy,
    // some fields omitted
}

Internal wrapper for an event, including the strategy and source entity.

Fields

source: Entitystrategy: EventStrategy

Implementations

impl EventBox[src]

pub fn new<E: Event>(event: E, strategy: EventStrategy, source: Entity) -> Self[src]

Creates a new EventBox.

pub fn is_type<E: Event>(&self) -> bool[src]

Check if the given type is the type of the event.

pub fn event_type(&self) -> TypeId[src]

Returns the type of the event.

pub fn downcast<E: Event>(self) -> Result<E, EventError>[src]

Downcasts the box to an concrete event.

pub fn downcast_ref<E: Any>(&self) -> Result<&E, EventError>[src]

Downcasts the box as reference of an concrete event.

Trait Implementations

impl Debug for EventBox[src]

Auto Trait Implementations

impl !RefUnwindSafe for EventBox

impl !Send for EventBox

impl !Sync for EventBox

impl Unpin for EventBox

impl !UnwindSafe for EventBox

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<E> Component for E where
    E: Any
[src]

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

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

impl<T> SetParameter for T

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.