pub struct NestedRouteConfig {
pub path: String,
pub component: Rc<dyn Fn() -> VirtualNode>,
pub children: Vec<NestedRouteConfig>,
}Expand description
A nested route configuration entry.
Routes form a tree: each route can have its own component (the “layout” or “page”) and zero or more child routes. The path of a child route is resolved against the parent path during matching.
Fields§
§path: StringThe route path (e.g. /settings/profile).
component: Rc<dyn Fn() -> VirtualNode>The component to render for this route.
children: Vec<NestedRouteConfig>The child routes, if any.
Implementations§
Source§impl NestedRouteConfig
impl NestedRouteConfig
Sourcepub fn new<F>(
path: impl Into<String>,
component: F,
children: Vec<NestedRouteConfig>,
) -> Selfwhere
F: Fn() -> VirtualNode + 'static,
pub fn new<F>(
path: impl Into<String>,
component: F,
children: Vec<NestedRouteConfig>,
) -> Selfwhere
F: Fn() -> VirtualNode + 'static,
Creates a new nested route configuration.
§Arguments
path: impl Into<String>- The route path.component: F- The component closure.children: Vec<NestedRouteConfig>- The child routes.
Sourcepub fn component(&self) -> Rc<dyn Fn() -> VirtualNode>
pub fn component(&self) -> Rc<dyn Fn() -> VirtualNode>
Returns the component closure.
Sourcepub fn children(&self) -> &[NestedRouteConfig]
pub fn children(&self) -> &[NestedRouteConfig]
Returns the child routes.
Trait Implementations§
Source§impl Clone for NestedRouteConfig
impl Clone for NestedRouteConfig
Source§fn clone(&self) -> NestedRouteConfig
fn clone(&self) -> NestedRouteConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for NestedRouteConfig
impl !Send for NestedRouteConfig
impl !Sync for NestedRouteConfig
impl !UnwindSafe for NestedRouteConfig
impl Freeze for NestedRouteConfig
impl Unpin for NestedRouteConfig
impl UnsafeUnpin for NestedRouteConfig
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