pub struct ModalState { /* private fields */ }Expand description
Stateful helper for modal close behavior.
Implementations§
Source§impl ModalState
impl ModalState
pub fn is_open(&self) -> bool
pub fn open(&mut self)
pub fn close(&mut self)
Sourcepub fn handle_event(
&mut self,
event: &Event,
hit: Option<(HitId, HitRegion, HitData)>,
config: &ModalConfig,
) -> Option<ModalAction>
pub fn handle_event( &mut self, event: &Event, hit: Option<(HitId, HitRegion, HitData)>, config: &ModalConfig, ) -> Option<ModalAction>
Handle events and return a modal action if triggered.
The caller should pass the hit-test result for the mouse event (usually from the last rendered frame).
Trait Implementations§
Source§impl Clone for ModalState
impl Clone for ModalState
Source§fn clone(&self) -> ModalState
fn clone(&self) -> ModalState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModalState
impl Debug for ModalState
Source§impl Default for ModalState
impl Default for ModalState
Source§impl PartialEq for ModalState
impl PartialEq for ModalState
impl Copy for ModalState
impl Eq for ModalState
impl StructuralPartialEq for ModalState
Auto Trait Implementations§
impl Freeze for ModalState
impl RefUnwindSafe for ModalState
impl Send for ModalState
impl Sync for ModalState
impl Unpin for ModalState
impl UnsafeUnpin for ModalState
impl UnwindSafe for ModalState
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.