pub struct NavController {
pub push: Box<dyn Fn(&str) -> bool>,
pub pop: Box<dyn Fn(bool) -> bool>,
pub current: Box<dyn Fn() -> String>,
pub enter: Box<dyn Fn(&str) -> bool>,
pub segments: Box<dyn Fn() -> Vec<String>>,
}Expand description
A mounted host’s control surface. Closures run user code (route builders), so the registry
NEVER holds a borrow across a call (§3.3 discipline: clone the Rc out, then call).
Fields§
§push: Box<dyn Fn(&str) -> bool>Push (or, in split/tab presentation, select) a registered route. False = unknown route.
pop: Box<dyn Fn(bool) -> bool>Pop the top route. already_popped = the native side popped first (iOS back).
False = nothing to pop (tabs hosts always return false: they have no stack).
current: Box<dyn Fn() -> String>Current route path (“” while showing the root).
enter: Box<dyn Fn(&str) -> bool>Consume one segment of an ABSOLUTE path. Selectors/tabs accept a declared key (same as
push); a stack accepts ANY segment by pushing it (its destinations are open-ended).
Distinct from push so a relative navigate("key") can still fall through a stack.
segments: Box<dyn Fn() -> Vec<String>>This surface’s contribution to the full route: [] at root, [key] for a selector /
tabs, the whole path for a stack.
Auto Trait Implementations§
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more