dom.rs 673 B

1234567891011121314151617181920212223242526272829303132
  1. //! webview dom
  2. use dioxus_core::{DomEdit, ElementId, ScopeId};
  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. }