#[repr(C)]pub struct Route {
pub pattern: AzString,
pub layout_callback: LayoutCallback,
}Expand description
A route mapping a URL pattern to a layout callback.
Routes are cross-platform: on desktop, switching routes swaps the
active layout callback and triggers RefreshDom. On web, it also
calls history.pushState() for browser navigation.
§Pattern syntax
"/"— exact root"/about"— exact path"/user/:id"— parameterized segment,/user/42yieldsid = "42"
§C API
AzAppConfig_addRoute(&config, AzString_fromConstStr("/user/:id"), layout_user);Fields§
§pattern: AzStringURL pattern (e.g. "/", "/about", "/user/:id")
layout_callback: LayoutCallbackLayout callback invoked when this route is active
Trait Implementations§
Source§impl Extend<Route> for RouteVec
impl Extend<Route> for RouteVec
Source§fn extend<T: IntoIterator<Item = Route>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Route>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl FromIterator<Route> for RouteVec
impl FromIterator<Route> for RouteVec
Source§impl Ord for Route
impl Ord for Route
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Route
impl PartialOrd for Route
impl Eq for Route
Auto Trait Implementations§
impl Freeze for Route
impl RefUnwindSafe for Route
impl Send for Route
impl Sync for Route
impl Unpin for Route
impl UnsafeUnpin for Route
impl UnwindSafe for Route
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