pub struct ParsedVirtualNode {
    pub tag: String,
    pub props: HashMap<String, String, RandomState>,
    pub custom_events: CustomEvents,
    pub browser_events: BrowserEvents,
    pub children: Option<Vec<Rc<RefCell<ParsedVirtualNode>>, Global>>,
    pub parent: Option<Rc<RefCell<ParsedVirtualNode>>>,
    pub text: Option<String>,
}
Expand description

Our html! macro takes in tokens, builds ParsedVirtualNode’s from those tokens and then finally converts that ParsedVirtualNode into a VirtualNode.

When we next revisit that macro we’ll want to revisit whether or not we can build a VirtualNode as we go vs. needing this intermediary data structure.

TODO: Is this complexity really necessary? Doubt it… Map this all out on paper… shouldn’t need two nearly identical structs…?

Fields§

§tag: String

TODO: See if we can get rid of ParsedVirtualNode entirely in favor of only VirtualNode

§props: HashMap<String, String, RandomState>

TODO: See if we can get rid of ParsedVirtualNode entirely in favor of only VirtualNode

§custom_events: CustomEvents

TODO: See if we can get rid of ParsedVirtualNode entirely in favor of only VirtualNode

§browser_events: BrowserEvents

TODO: See if we can get rid of ParsedVirtualNode entirely in favor of only VirtualNode

§children: Option<Vec<Rc<RefCell<ParsedVirtualNode>>, Global>>

TODO: See if we can get rid of ParsedVirtualNode entirely in favor of only VirtualNode TODO: Don’t think this needs to be an option

§parent: Option<Rc<RefCell<ParsedVirtualNode>>>

TODO: See if we can get rid of ParsedVirtualNode entirely in favor of only VirtualNode

§text: Option<String>

TODO: See if we can get rid of ParsedVirtualNode entirely in favor of only VirtualNode

Implementations§

Create a virtual node that is meant to represent a DOM element

Create a virtual node that is meant to represent DOM Text

Take off the the VirtualNode’s direct descendants (who in turn might have their own descendants)

Trait Implementations§

Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.