borrowed.rs 806 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. use dioxus::prelude::*;
  2. use dioxus_core as dioxus;
  3. use dioxus_core_macro::*;
  4. use dioxus_html as dioxus_elements;
  5. fn main() {}
  6. fn App(cx: Scope<()>) -> Element {
  7. cx.render(rsx!(div {
  8. App2 {
  9. p: "asd"
  10. }
  11. }))
  12. }
  13. #[derive(Props)]
  14. struct Borrowed<'a> {
  15. p: &'a str,
  16. }
  17. fn App2<'a>(cx: Scope<'a, Borrowed<'a>>) -> Element {
  18. let g = eat2(&cx);
  19. todo!()
  20. }
  21. fn eat2(s: &ScopeState) {}
  22. fn eat(f: &str) {}
  23. fn bleat() {
  24. let blah = String::from("asd");
  25. eat(&blah);
  26. }
  27. // struct Lower {}
  28. // #[derive(Clone, Copy)]
  29. // struct Upper {}
  30. // impl std::ops::Deref for Upper {
  31. // type Target = Lower;
  32. // fn deref(&self) -> &Self::Target {
  33. // todo!()
  34. // }
  35. // }
  36. // fn mark(f: &Lower) {}
  37. // fn bark() {
  38. // let up = Upper {};
  39. // mark(&up);
  40. // }