#[non_exhaustive]pub enum RenderableTreeNode {
Tag(Box<Tag>),
Scalar(Scalar),
}Expand description
One node of a renderable tree: a tag, or a value.
Upstream’s RenderableTreeNode = Tag | Scalar. A renderer walks these and a
host may build them by hand, which is what makes a renderer outside this
crate possible – the React renderers upstream ships are not ported, and this
is the type that keeps writing one an option rather than a fork.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Tag(Box<Tag>)
An element: a name, attributes, and children.
Boxed because Tag contains a Vec<RenderableTreeNode>, so an
unboxed variant would make the enum’s size the tag’s.
Scalar(Scalar)
A value rendered in place – most often the string of a text node.
Implementations§
Source§impl RenderableTreeNode
impl RenderableTreeNode
Sourcepub fn tag(tag: Tag) -> RenderableTreeNode
pub fn tag(tag: Tag) -> RenderableTreeNode
Wrap a tag.
Sourcepub fn text(text: impl Into<String>) -> RenderableTreeNode
pub fn text(text: impl Into<String>) -> RenderableTreeNode
Wrap a string, which is what a text node renders to.
Trait Implementations§
Source§impl Clone for RenderableTreeNode
impl Clone for RenderableTreeNode
Source§fn clone(&self) -> RenderableTreeNode
fn clone(&self) -> RenderableTreeNode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RenderableTreeNode
impl Debug for RenderableTreeNode
Source§impl From<RenderableTreeNode> for RenderableTreeNodes
impl From<RenderableTreeNode> for RenderableTreeNodes
Source§fn from(node: RenderableTreeNode) -> RenderableTreeNodes
fn from(node: RenderableTreeNode) -> RenderableTreeNodes
Converts to this type from the input type.
Source§impl PartialEq for RenderableTreeNode
impl PartialEq for RenderableTreeNode
impl StructuralPartialEq for RenderableTreeNode
Auto Trait Implementations§
impl Freeze for RenderableTreeNode
impl RefUnwindSafe for RenderableTreeNode
impl Send for RenderableTreeNode
impl Sync for RenderableTreeNode
impl Unpin for RenderableTreeNode
impl UnsafeUnpin for RenderableTreeNode
impl UnwindSafe for RenderableTreeNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more