pub struct Event {
pub propagate: bool,
pub future: Option<Pin<Box<dyn Future<Output = Box<dyn Any + Send + Sync>> + Send>>>,
pub prevent_defaults: bool,
pub target: Option<String>,
pub current_target: Option<String>,
pub window: WindowContext,
/* private fields */
}Expand description
The result of an update.
Fields§
§propagate: boolPropagate craft_events to the next element. True by default.
future: Option<Pin<Box<dyn Future<Output = Box<dyn Any + Send + Sync>> + Send>>>A future that will produce a message when complete. The message will be sent to the origin component.
prevent_defaults: boolPrevent default event handlers from running when an craft_event is not explicitly handled. False by default.
target: Option<String>§current_target: Option<String>§window: WindowContextImplementations§
Source§impl Event
impl Event
pub fn with_window_context(window: WindowContext) -> Event
pub fn async_result<T>(t: T) -> Box<dyn Any + Send + Sync>
pub fn async_no_result() -> Box<dyn Any + Send>
Source§impl Event
impl Event
pub fn new() -> Event
pub fn pinned_future( &mut self, future: Pin<Box<dyn Future<Output = Box<dyn Any + Send + Sync>> + Send>>, )
pub fn future<F>(&mut self, future: F)
pub fn prevent_defaults(&mut self)
pub fn prevent_propagate(&mut self)
pub fn pointer_capture(&mut self, pointer_capture: PointerCapture)
pub fn add_effect( &mut self, event_dispatch_type: EventDispatchType, message: Message, )
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Event
impl !RefUnwindSafe for Event
impl Send for Event
impl !Sync for Event
impl Unpin for Event
impl !UnwindSafe for Event
Blanket Implementations§
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.