lib.rs 360 B

12345678910111213141516171819
  1. mod utils;
  2. use wasm_bindgen::prelude::*;
  3. // When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
  4. // allocator.
  5. #[cfg(feature = "wee_alloc")]
  6. #[global_allocator]
  7. static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
  8. #[wasm_bindgen]
  9. extern {
  10. fn alert(s: &str);
  11. }
  12. #[wasm_bindgen]
  13. pub fn greet() {
  14. alert("Hello, client!");
  15. }