pub struct GoRouterState { /* private fields */ }Expand description
Where a page is: what location it was reached at, which route it is, and what the
location said — the values of the path’s :parameters, and the query.
Implementations§
Source§impl GoRouterState
impl GoRouterState
Sourcepub fn entering(&self) -> f32
pub fn entering(&self) -> f32
How far into view this page is: 1.0 once it has settled, and while a transition
brings it in or takes it out, the number that transition is driven by — 0.0 not yet
arrived. A page that wants to move its own contents as it arrives reads it, and one
that does not ignores it.
Sourcepub fn path(&self) -> &str
pub fn path(&self) -> &str
The pattern of the route that answered: /users/:id. Empty when no route did.
Sourcepub fn param(&self, name: &str) -> Option<&str>
pub fn param(&self, name: &str) -> Option<&str>
The value of the path parameter name — 42 for :id in /users/42.
Sourcepub fn query(&self, name: &str) -> Option<&str>
pub fn query(&self, name: &str) -> Option<&str>
The value of the query parameter name — posts for tab in ?tab=posts. When it
is given more than once, the last one.
Sourcepub fn query_params(&self) -> &HashMap<String, String>
pub fn query_params(&self) -> &HashMap<String, String>
Every query parameter of the location.
Sourcepub fn extra<T: 'static>(&self) -> Option<Rc<T>>
pub fn extra<T: 'static>(&self) -> Option<Rc<T>>
The object that came along with the navigation (GoRouter::go_with_extra), if it
is a T.