pub struct OverlayGuard { /* private fields */ }Expand description
RAII owner of a shown overlay entry.
Dropping the guard dismisses the entry, so callers can’t leak entries by
forgetting dismiss or mismatching a 0-sentinel id. The typical shape
is a remember-ed RefCell<Option<OverlayGuard>>: set it to Some when
the overlay should show, back to None to hide.
The guard holds only the handle + id (no entry content), so it never participates in reference cycles with the overlay state.
Implementations§
Source§impl OverlayGuard
impl OverlayGuard
Sourcepub fn show(
handle: &OverlayHandle,
builder: Rc<dyn Fn() -> View>,
z_index: f32,
pass_through: bool,
) -> Self
pub fn show( handle: &OverlayHandle, builder: Rc<dyn Fn() -> View>, z_index: f32, pass_through: bool, ) -> Self
Show builder on handle and own the resulting entry.
pub fn show_with_back( handle: &OverlayHandle, builder: Rc<dyn Fn() -> View>, z_index: f32, pass_through: bool, back_handler: BackHandler, ) -> Self
Trait Implementations§
Source§impl Drop for OverlayGuard
impl Drop for OverlayGuard
Auto Trait Implementations§
impl !RefUnwindSafe for OverlayGuard
impl !Send for OverlayGuard
impl !Sync for OverlayGuard
impl !UnwindSafe for OverlayGuard
impl Freeze for OverlayGuard
impl Unpin for OverlayGuard
impl UnsafeUnpin for OverlayGuard
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