pub trait LiveviewRouter {
// Required methods
fn create_default_liveview_router() -> Self;
fn with_virtual_dom(
self,
route: &str,
app: impl Fn() -> VirtualDom + Send + Sync + 'static,
) -> Self;
fn start(self, address: impl Into<SocketAddr>) -> impl Future<Output = ()>;
// Provided method
fn with_app(self, route: &str, app: fn() -> Element) -> Self
where Self: Sized { ... }
}
Expand description
A trait for servers that can be used to host a LiveView app.
Required Methods§
Sourcefn create_default_liveview_router() -> Self
fn create_default_liveview_router() -> Self
Create a new router.
Sourcefn with_virtual_dom(
self,
route: &str,
app: impl Fn() -> VirtualDom + Send + Sync + 'static,
) -> Self
fn with_virtual_dom( self, route: &str, app: impl Fn() -> VirtualDom + Send + Sync + 'static, ) -> Self
Add a liveview route to the server from a virtual dom.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.