pub enum NodeOrString {
Node(NodeId),
Text(String),
}Expand description
Either an existing node (by id) or a string to be wrapped in a
fresh text node. Built via From impls so call sites read
naturally — see module docs for an example.
The variant is named Text (not String) to keep the carrier
semantics explicit: a Text value becomes a Text node in
the DOM, never inline markup.
Variants§
Node(NodeId)
An existing node — will be linked into the destination by id. The caller is responsible for ensuring the node id is valid for the target Dom.
Text(String)
Text content — the receiver will create a fresh Text
node carrying this string.
Trait Implementations§
Source§impl Clone for NodeOrString
impl Clone for NodeOrString
Source§impl Debug for NodeOrString
impl Debug for NodeOrString
impl Eq for NodeOrString
Source§impl From<&String> for NodeOrString
impl From<&String> for NodeOrString
Source§impl From<&str> for NodeOrString
impl From<&str> for NodeOrString
Source§impl From<NodeId> for NodeOrString
impl From<NodeId> for NodeOrString
Source§impl From<String> for NodeOrString
impl From<String> for NodeOrString
Source§impl Hash for NodeOrString
impl Hash for NodeOrString
Source§impl PartialEq for NodeOrString
impl PartialEq for NodeOrString
impl StructuralPartialEq for NodeOrString
Auto Trait Implementations§
impl Freeze for NodeOrString
impl RefUnwindSafe for NodeOrString
impl Send for NodeOrString
impl Sync for NodeOrString
impl Unpin for NodeOrString
impl UnsafeUnpin for NodeOrString
impl UnwindSafe for NodeOrString
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