Split the crate in 3, introduce JS frontend

This commit is contained in:
Valentin Tolmer
2021-05-08 11:34:55 +02:00
parent 9459f53a13
commit c58459547b
9 changed files with 119 additions and 39 deletions

32
app/src/app.rs Normal file
View File

@@ -0,0 +1,32 @@
use lldap_model::*;
use yew::prelude::*;
pub struct App {}
pub enum Msg {
BindRequest(BindRequest),
ListUsersRequest(ListUsersRequest),
}
impl Component for App {
type Message = Msg;
type Properties = ();
fn create(_: Self::Properties, _: ComponentLink<Self>) -> Self {
App {}
}
fn update(&mut self, _msg: Self::Message) -> ShouldRender {
true
}
fn change(&mut self, _: Self::Properties) -> ShouldRender {
false
}
fn view(&self) -> Html {
html! {
<p>{ "Hello world!" }</p>
}
}
}

10
app/src/lib.rs Normal file
View File

@@ -0,0 +1,10 @@
mod app;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub fn run_app() -> Result<(), JsValue> {
yew::start_app::<app::App>();
Ok(())
}