sauron_native/backend.rs
1use crate::{Component, Node, Widget};
2use std::{fmt::Debug, rc::Rc};
3
4#[cfg(feature = "with-html")]
5pub mod html;
6#[cfg(feature = "with-html")]
7pub use html::HtmlBackend;
8#[cfg(feature = "with-tui")]
9pub mod text_ui;
10
11#[cfg(feature = "with-gtk")]
12pub mod gtk_ui;
13
14pub trait Backend<APP, MSG>
15where
16 MSG: Clone + Debug + 'static,
17 APP: Component<MSG> + 'static,
18{
19 fn init(app: APP) -> Rc<Self>;
20
21 fn start_render(self: &Rc<Self>) {
22 // html backend don't use render loop
23 //
24 // this is useful for tui backend
25 }
26}