pub struct NavOptions<R> { /* private fields */ }Expand description
How NavController::navigate_with changes the back stack — Android’s
NavOptions.
Implementations§
Sourcepub fn pop_up_to(self, route: R, inclusive: bool) -> Self
pub fn pop_up_to(self, route: R, inclusive: bool) -> Self
Pops the entries above the topmost route before navigating, and that
entry too when inclusive — Android’s popUpTo(route) { inclusive }.
Nothing is popped when route is not on the back stack.
Sourcepub fn launch_single_top(self) -> Self
pub fn launch_single_top(self) -> Self
Does not push the route when it is already on top — Android’s
launchSingleTop = true.
Sourcepub fn save_state(self) -> Self
pub fn save_state(self) -> Self
Keeps the entries that Self::pop_up_to pops, with their view
models and saved state, for a later navigation with
Self::restore_state to bring back — Android’s
popUpTo(route) { saveState = true }. A tab bar uses it to give each
tab its own back stack.
Sourcepub fn restore_state(self) -> Self
pub fn restore_state(self) -> Self
Brings back the entries a Self::save_state pop kept for the route,
bottom first, in place of a new entry for it — Android’s
restoreState = true. Without such entries the route is pushed as
usual.