dioxus_liveview

Trait LiveviewRouter

Source
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§

Source

fn create_default_liveview_router() -> Self

Create a new router.

Source

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.

Source

fn start(self, address: impl Into<SocketAddr>) -> impl Future<Output = ()>

Start the server on an address.

Provided Methods§

Source

fn with_app(self, route: &str, app: fn() -> Element) -> Self
where Self: Sized,

Add a liveview route to the server from a component

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.

Implementors§