Skip to main content

Crate blinc_router

Crate blinc_router 

Source
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 Div

Re-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.
RouterBuilder
Router builder

Enums§

GuardResult
Result of a navigation guard check

Functions§

cli_deep_link
Check CLI arguments for a --deep-link=URI flag 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§

NavigationGuard
Navigation guard
RouteView
Route view function: receives context, returns a Div