Skip to main content

NavStackExt

Trait NavStackExt 

Source
pub trait NavStackExt {
    // Required methods
    fn discard_forward(&self, cx: &mut App);
    fn pop_and_discard(
        &self,
        motion: NavMotion,
        cx: &mut App,
    ) -> Option<AnyView>;
}
Expand description

Navigation that also frees pages.

A popped page waits in the stack’s forward history until the next push, so its view stays alive. These methods drop that history, so a page the application will not bring back releases its state.

Required Methods§

Source

fn discard_forward(&self, cx: &mut App)

Drops the forward history at once, keeping the views from the root to the current page. The stack reports Cleared and then one Pushed per kept page. A running transition is abandoned.

Source

fn pop_and_discard(&self, motion: NavMotion, cx: &mut App) -> Option<AnyView>

Pops the top view like NavStackState::pop, then drops it from the forward history once its exit transition has run, so forward cannot bring it back and nothing keeps it alive. Returns the popped view, or None at the root.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl NavStackExt for Entity<NavStackState>

Source§

fn discard_forward(&self, cx: &mut App)

Source§

fn pop_and_discard(&self, motion: NavMotion, cx: &mut App) -> Option<AnyView>

Implementors§