dummy.rs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #![allow(unused, non_upper_case_globals)]
  2. use bumpalo::Bump;
  3. use dioxus_core::prelude::VNode;
  4. use dioxus_core::prelude::*;
  5. use dioxus_core::{nodebuilder::*, virtual_dom::Properties};
  6. use once_cell::sync::{Lazy, OnceCell};
  7. use std::{collections::HashMap, future::Future, marker::PhantomData};
  8. fn main() {}
  9. // struct VC<P, F = fn(Context<P>) -> VNode> {
  10. // f: F,
  11. // _a: std::marker::PhantomData<(P, F)>, // cell: OnceCell<T>,
  12. // // init: Cell<Option<F>>
  13. // }
  14. // impl<P, F> VC<P, F> {
  15. // const fn new(init: F) -> VC<P, F> {
  16. // Self {
  17. // _a: std::marker::PhantomData {},
  18. // f: init,
  19. // }
  20. // }
  21. // fn builder() -> P {
  22. // // P::new()
  23. // }
  24. // }
  25. // // Build a new functional component
  26. // static SomeComp: VC<()> = VC::new(|ctx| {
  27. // // This is a component, apparently
  28. // // still not useful because we can't have bounds
  29. // ctx.view(html! {
  30. // <div>
  31. // </div>
  32. // })
  33. // });
  34. /*
  35. */
  36. static BILL: Lazy<fn(Context<()>) -> String> = Lazy::new(|| {
  37. //
  38. |c| "BLAH".to_string()
  39. });
  40. // struct FUNC<F = fn() -> T> {}
  41. struct SomeBuilder {}
  42. // struct DummyRenderer {
  43. // alloc: Bump,
  44. // }
  45. // impl DummyRenderer {
  46. // // "Renders" a domtree by logging its children and outputs
  47. // fn render() {}
  48. // // Takes a domtree, an initial value, a new value, and produces the diff list
  49. // fn produce_diffs() {}
  50. // }
  51. // struct Props<'a> {
  52. // name: &'a str,
  53. // }
  54. // /// This component does "xyz things"
  55. // /// This is sample documentation
  56. // static Component: FC<Props> = |ctx| {
  57. // // This block mimics that output of the html! macro
  58. // DomTree::new(move |bump| {
  59. // // parse into RSX structures
  60. // // regurgetate as rust types
  61. // // <div> "Child 1" "Child 2"</div>
  62. // div(bump)
  63. // .attr("class", "edit")
  64. // .child(text("Child 1"))
  65. // .child(text("Child 2"))
  66. // .finish()
  67. // })
  68. // };
  69. // /*
  70. // source
  71. // |> c1 -> VNode
  72. // |> c2 -> VNode
  73. // |> c3 -> VNode
  74. // |> c4 -> VNode
  75. // */