use crate::{Method, SsrMode};
use leptos::{leptos_dom::View, *};
use std::rc::Rc;
#[derive(Clone)]
pub struct RouteDefinition {
pub id: usize,
pub path: String,
pub children: Vec<RouteDefinition>,
pub view: Rc<dyn Fn(Scope) -> View>,
pub ssr_mode: SsrMode,
pub methods: &'static [Method],
}
impl std::fmt::Debug for RouteDefinition {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("RouteDefinition")
.field("path", &self.path)
.field("children", &self.children)
.field("ssr_mode", &self.ssr_mode)
.finish()
}
}
impl PartialEq for RouteDefinition {
fn eq(&self, other: &Self) -> bool {
self.path == other.path && self.children == other.children
}
}