#[non_exhaustive]pub enum PopupIntent {
Present {
popup_id: PopupId,
},
MoveFocusInto {
popup_id: PopupId,
trap: bool,
},
Dismiss {
popup_id: PopupId,
reason: PopupDismissReason,
},
RestoreFocus {
owner: PopupOwner,
},
}Expand description
Host-independent side effect emitted by PopupPortal.
Intents are ordered: presentation precedes focus movement on open; subtree dismissals precede optional owner focus restoration on close. The enum is non-exhaustive.
§Examples
use ailloli_ui_runtime::popup::{PopupId, PopupIntent};
assert!(matches!(PopupIntent::Present { popup_id: PopupId::new(1) }, PopupIntent::Present { .. }));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Present
Ask the selected backend to present or raise a popup.
MoveFocusInto
Ask input routing to focus the first retained popup descendant.
Fields
Dismiss
Ask a backend to hide a popup for the recorded reason.
Fields
§
reason: PopupDismissReasonLifecycle/input reason for dismissal.
RestoreFocus
Restore focus only if the host can still resolve this complete owner.
Fields
§
owner: PopupOwnerExact owner that should regain focus if it is still live/current.
Trait Implementations§
Source§impl Clone for PopupIntent
impl Clone for PopupIntent
Source§fn clone(&self) -> PopupIntent
fn clone(&self) -> PopupIntent
Returns a copy 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 PopupIntent
impl Debug for PopupIntent
Source§impl PartialEq for PopupIntent
impl PartialEq for PopupIntent
impl Eq for PopupIntent
impl StructuralPartialEq for PopupIntent
Auto Trait Implementations§
impl Freeze for PopupIntent
impl RefUnwindSafe for PopupIntent
impl Send for PopupIntent
impl Sync for PopupIntent
impl Unpin for PopupIntent
impl UnwindSafe for PopupIntent
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
Source§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.