dom.rs 946 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //! webview dom
  2. use dioxus_core::{DomEdit, RealDom, RealDomNode, ScopeIdx};
  3. use DomEdit::*;
  4. pub struct WebviewRegistry {}
  5. impl WebviewRegistry {
  6. pub fn new() -> Self {
  7. Self {}
  8. }
  9. }
  10. pub struct WebviewDom<'bump> {
  11. pub edits: Vec<DomEdit<'bump>>,
  12. pub node_counter: u64,
  13. pub registry: WebviewRegistry,
  14. }
  15. impl WebviewDom<'_> {
  16. pub fn new(registry: WebviewRegistry) -> Self {
  17. Self {
  18. edits: Vec::new(),
  19. node_counter: 0,
  20. registry,
  21. }
  22. }
  23. // Finish using the dom (for its edit list) and give back the node and event registry
  24. pub fn consume(self) -> WebviewRegistry {
  25. self.registry
  26. }
  27. }
  28. impl<'bump> RealDom<'bump> for WebviewDom<'bump> {
  29. fn raw_node_as_any(&self) -> &mut dyn std::any::Any {
  30. todo!()
  31. // self.edits.push(PushRoot { root });
  32. }
  33. fn request_available_node(&mut self) -> RealDomNode {
  34. todo!()
  35. }
  36. }