dioxus_liveview/adapters/
mod.rs1use std::future::Future;
2
3use dioxus_core::{Element, VirtualDom};
4
5#[cfg(feature = "axum")]
6pub mod axum_adapter;
7#[cfg(feature = "axum")]
8pub use axum_adapter::*;
9
10pub trait LiveviewRouter {
12 fn create_default_liveview_router() -> Self;
14
15 fn with_app(self, route: &str, app: fn() -> Element) -> Self
17 where
18 Self: Sized,
19 {
20 self.with_virtual_dom(route, move || VirtualDom::new(app))
21 }
22
23 fn with_virtual_dom(
25 self,
26 route: &str,
27 app: impl Fn() -> VirtualDom + Send + Sync + 'static,
28 ) -> Self;
29
30 fn start(self, address: impl Into<std::net::SocketAddr>) -> impl Future<Output = ()>;
32}