freya_router/components/
outlet.rs1use std::marker::PhantomData;
2
3use freya_core::prelude::*;
4
5use crate::prelude::{
6 outlet::OutletContext,
7 *,
8};
9
10struct Outlet<R>(PhantomData<R>);
11
12impl<R> PartialEq for Outlet<R> {
13 fn eq(&self, _other: &Self) -> bool {
14 true
15 }
16}
17
18impl<R: Routable> Render for Outlet<R> {
19 fn render(&self) -> impl IntoElement {
20 OutletContext::<R>::render()
21 }
22}
23
24pub fn outlet<R: Routable + Clone>() -> Element {
25 Outlet::<R>(PhantomData).into()
26}