pub trait Backend {
type Widget<'a>;
type Message: Clone + 'static;
fn text<'a>(&self, content: &str) -> Self::Widget<'a>;
fn button<'a>(
&self,
label: Self::Widget<'a>,
on_press: Option<Self::Message>,
) -> Self::Widget<'a>;
fn column<'a>(&self, children: Vec<Self::Widget<'a>>) -> Self::Widget<'a>;
fn row<'a>(&self, children: Vec<Self::Widget<'a>>) -> Self::Widget<'a>;
fn container<'a>(&self, content: Self::Widget<'a>) -> Self::Widget<'a>;
fn scrollable<'a>(&self, content: Self::Widget<'a>) -> Self::Widget<'a>;
fn stack<'a>(&self, children: Vec<Self::Widget<'a>>) -> Self::Widget<'a>;
fn text_input<'a>(
&self,
placeholder: &str,
value: &str,
on_input: Option<Self::Message>,
) -> Self::Widget<'a>;
fn checkbox<'a>(
&self,
label: &str,
is_checked: bool,
on_toggle: Option<Self::Message>,
) -> Self::Widget<'a>;
fn slider<'a>(
&self,
min: f32,
max: f32,
value: f32,
on_change: Option<Self::Message>,
) -> Self::Widget<'a>;
fn pick_list<'a>(
&self,
options: Vec<&str>,
selected: Option<&str>,
on_select: Option<Self::Message>,
) -> Self::Widget<'a>;
fn toggler<'a>(
&self,
label: &str,
is_active: bool,
on_toggle: Option<Self::Message>,
) -> Self::Widget<'a>;
fn image<'a>(&self, path: &str) -> Self::Widget<'a>;
fn svg<'a>(&self, path: &str) -> Self::Widget<'a>;
fn space<'a>(&self) -> Self::Widget<'a>;
fn rule<'a>(&self) -> Self::Widget<'a>;
fn radio<'a>(
&self,
label: &str,
value: &str,
selected: Option<&str>,
on_select: Option<Self::Message>,
) -> Self::Widget<'a>;
}