pub struct GoRoute { /* private fields */ }Expand description
One place the router can go: a pattern of path, and the page it builds.
A path is made of segments: a literal (users), a parameter (:id), or a trailing *
that takes whatever is left. A top-level route’s path starts with /; a sub-route’s is
relative to its parent’s and does not.
Implementations§
Source§impl GoRoute
impl GoRoute
Sourcepub fn new<W: Widget + 'static>(
path: impl Into<String>,
builder: impl Fn(&BuildContext<'_>, &GoRouterState) -> W + 'static,
) -> Self
pub fn new<W: Widget + 'static>( path: impl Into<String>, builder: impl Fn(&BuildContext<'_>, &GoRouterState) -> W + 'static, ) -> Self
A route answering to path, building its page with builder.
builder is told the GoRouterState — where the location put the person — and may
return any widget: a Component, a Box<dyn Widget>, a
scaffold.
Sourcepub fn name(self, name: impl Into<String>) -> Self
pub fn name(self, name: impl Into<String>) -> Self
Names the route, so it can be reached without writing its path:
GoRouter::go_named.
Auto Trait Implementations§
impl !RefUnwindSafe for GoRoute
impl !Send for GoRoute
impl !Sync for GoRoute
impl !UnwindSafe for GoRoute
impl Freeze for GoRoute
impl Unpin for GoRoute
impl UnsafeUnpin for GoRoute
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
Mutably borrows from an owned value. Read more