Expand description
Stack-based routing utilities for shard components.
Each #[shard]
function generates a *Destination
type that implements
RouterDestination
. These destinations are managed in a LIFO stack.
§Responsibilities
- Maintain an ordered stack (
route_stack
) of active destinations - Expose [
push
] / [pop
] helpers that also manage shard state lifetimes - Remove per‑shard state from the registry when a destination whose lifecycle is
ShardStateLifeCycle::Shard
is popped - Keep routing logic minimal; rendering happens when the top destination’s
exec_component()
is invoked every frame byrouter_root
§Typical Usage
ⓘ
// Navigate forward
tessera_ui::router::push(HomeScreenDestination { /* fields */ });
// Navigate back
tessera_ui::router::pop();
§Related
#[shard]
macro – generates the*Destination
structs + optional state injectiontessera_ui::router::router_root
– executes the current top destination each frame
Structs§
Traits§
- Router
Destination - A navigation destination produced automatically by the
#[shard]
macro.