pub enum BackPolicy {
Pop,
DismissAnimated,
Veto,
}Expand description
How a page participates in a back press routed through
NavigatorController::request_back (Android hardware/gesture back, via
the facade’s back-press wiring). A page declares its policy when pushed via
PushOptions::back; every existing push defaults to Pop.
This is internal routing vocabulary — the user-facing overlay builder is
dismissable(bool), which maps true → DismissAnimated and
false → Veto when the overlay pushes its transparent page.
§The DismissAnimated observation seam
A DismissAnimated page does not pop on the back
press itself; instead the navigator increments the page’s
dismiss_signal generation counter, which the
page’s own widget subtree observes (comparing the shared Rc<Cell<u64>>
against a last-seen value on its next paint/event) and turns into its own
begin_exit staging — the overlay then pops itself on exit completion via
its existing on-close path. This keeps frust-widgets reactive-free (a plain
shared cell, mirroring NavigatorController::depth’s
Rc<Cell<usize>>) — no frust-reactive dependency crosses into this crate.
An overlay helper (show_command_palette/show_dialog/show_bottom_sheet)
wires the seam by creating one cell, handing a clone to the overlay widget it
builds and into PushOptions::dismiss_signal.
Variants§
Pop
The default: a back press pops this page (the normal
pop path, transitions preserved). A back
press at the root (this being the only page) is a safe no-op.
DismissAnimated
A dismissable overlay: a back press fires the page’s
dismiss_signal (see the seam above)
rather than popping — the stack is unchanged immediately, and the overlay
animates its own exit before popping itself.
Veto
A non-dismissable overlay (a modal barrier): a back press is consumed (the page claims it, so it never bubbles to the platform) but does nothing — the stack is unchanged and no signal fires.
Trait Implementations§
Source§impl Clone for BackPolicy
impl Clone for BackPolicy
Source§fn clone(&self) -> BackPolicy
fn clone(&self) -> BackPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BackPolicy
Source§impl Debug for BackPolicy
impl Debug for BackPolicy
impl Eq for BackPolicy
Source§impl PartialEq for BackPolicy
impl PartialEq for BackPolicy
impl StructuralPartialEq for BackPolicy
Auto Trait Implementations§
impl Freeze for BackPolicy
impl RefUnwindSafe for BackPolicy
impl Send for BackPolicy
impl Sync for BackPolicy
impl Unpin for BackPolicy
impl UnsafeUnpin for BackPolicy
impl UnwindSafe for BackPolicy
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
key and return true if they are equal.