Expand description
Cross-platform routing for Blinc
Declarative routing with path matching, navigation history, and guards. Routers are scoped — not global singletons.
§Example
ⓘ
use blinc_router::{RouterBuilder, Route};
// Build the router (returns a clonable handle)
let router = RouterBuilder::new()
.route(Route::new("/").name("home").view(home_page))
.route(Route::new("/users/:id").view(user_detail))
.not_found(not_found_page)
.build();
// Navigate
router.push("/users/42");
router.back();
// Build current route's view
let page = router.outlet(); // returns DivRe-exports§
pub use history::HistoryEntry;pub use route::MatchedRoute;pub use route::QueryParams;pub use route::Route;pub use route::RouteContext;pub use route::RouteParams;pub use transition::PageTransition;
Modules§
- history
- Navigation history stack
- route
- Route definition and path matching
- transition
- Page transition configuration
Structs§
- Router
- A router instance. Clone to share across closures.
- Router
Builder - Router builder
Enums§
- Guard
Result - Result of a navigation guard check
Functions§
- cli_
deep_ link - Check CLI arguments for a
--deep-link=URIflag and return the URI. - dispatch_
deep_ link - Dispatch an incoming deep link URI to the registered router.
- use_
params - Get the current route’s parameters (convenience for
use_router().params()) - use_
query - Get the current route’s query parameters
- use_
router - Get the currently active router.
Type Aliases§
- Navigation
Guard - Navigation guard
- Route
View - Route view function: receives context, returns a Div