pub struct EventHandlers { /* private fields */ }Expand description
Attached event listener slots on a SceneNode.
Implementations§
Source§impl EventHandlers
Safe handler lookup for EventHandlers.
impl EventHandlers
Safe handler lookup for EventHandlers.
Sourcepub const fn empty() -> EventHandlers
pub const fn empty() -> EventHandlers
Constructs an empty EventHandlers table in const contexts without heap allocation.
§Returns
Self- Empty event handler collection with all callback slots set toNone.
Sourcepub fn handler_for(
&self,
kind: &UiEventKind,
) -> Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>
pub fn handler_for( &self, kind: &UiEventKind, ) -> Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>
Source§impl EventHandlers
impl EventHandlers
pub fn get_mut_on_click( &mut self, ) -> &mut Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>
pub fn set_on_click( &mut self, val: Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>, ) -> &mut EventHandlers
pub fn get_mut_on_pointer_down( &mut self, ) -> &mut Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>
pub fn set_on_pointer_down( &mut self, val: Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>, ) -> &mut EventHandlers
pub fn get_mut_on_pointer_move( &mut self, ) -> &mut Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>
pub fn set_on_pointer_move( &mut self, val: Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>, ) -> &mut EventHandlers
pub fn get_mut_on_pointer_up( &mut self, ) -> &mut Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>
pub fn set_on_pointer_up( &mut self, val: Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>, ) -> &mut EventHandlers
pub fn get_mut_on_pointer_cancel( &mut self, ) -> &mut Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>
pub fn set_on_pointer_cancel( &mut self, val: Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>, ) -> &mut EventHandlers
pub fn get_mut_on_pointer_enter( &mut self, ) -> &mut Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>
pub fn set_on_pointer_enter( &mut self, val: Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>, ) -> &mut EventHandlers
pub fn get_mut_on_pointer_leave( &mut self, ) -> &mut Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>
pub fn set_on_pointer_leave( &mut self, val: Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>, ) -> &mut EventHandlers
pub fn get_mut_on_scroll( &mut self, ) -> &mut Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>
pub fn set_on_scroll( &mut self, val: Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>, ) -> &mut EventHandlers
pub fn get_mut_on_key_down( &mut self, ) -> &mut Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>
pub fn set_on_key_down( &mut self, val: Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>, ) -> &mut EventHandlers
pub fn get_mut_on_change( &mut self, ) -> &mut Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>
pub fn set_on_change( &mut self, val: Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>, ) -> &mut EventHandlers
pub fn get_mut_on_focus( &mut self, ) -> &mut Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>
pub fn set_on_focus( &mut self, val: Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>, ) -> &mut EventHandlers
pub fn get_mut_on_blur( &mut self, ) -> &mut Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>
pub fn set_on_blur( &mut self, val: Option<Rc<RefCell<dyn FnMut(&UiEvent)>>>, ) -> &mut EventHandlers
Trait Implementations§
Source§impl Clone for EventHandlers
impl Clone for EventHandlers
Source§fn clone(&self) -> EventHandlers
fn clone(&self) -> EventHandlers
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for EventHandlers
impl Default for EventHandlers
Source§fn default() -> EventHandlers
fn default() -> EventHandlers
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for EventHandlers
impl !Send for EventHandlers
impl !Sync for EventHandlers
impl !UnwindSafe for EventHandlers
impl Forget for EventHandlers
impl Freeze for EventHandlers
impl Move for EventHandlers
impl Unpin for EventHandlers
impl UnsafeUnpin for EventHandlerswhere
*const RcInner<RefCell<dyn FnMut(&UiEvent)>> is !null: UnsafeUnpin,
PhantomData<RcInner<RefCell<dyn FnMut(&UiEvent)>>>: UnsafeUnpin,
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