Trait CustomNode

Source
pub trait CustomNode:
    Debug
    + Send
    + Sync {
    // Required methods
    fn write(&self, writer: &mut dyn CustomNodeWriter) -> WriteResult<()>;
    fn clone_box(&self) -> Box<dyn CustomNode>;
    fn eq_box(&self, other: &dyn CustomNode) -> bool;
    fn is_block(&self) -> bool;
    fn as_any(&self) -> &dyn Any;
}
Expand description

Trait for implementing custom node behavior

Required Methods§

Source

fn write(&self, writer: &mut dyn CustomNodeWriter) -> WriteResult<()>

Write the custom node content to the provided writer

Source

fn clone_box(&self) -> Box<dyn CustomNode>

Clone the custom node

Source

fn eq_box(&self, other: &dyn CustomNode) -> bool

Check if two custom nodes are equal

Source

fn is_block(&self) -> bool

Whether the custom node is a block element

Source

fn as_any(&self) -> &dyn Any

Convert to Any for type casting

Trait Implementations§

Source§

impl Clone for Box<dyn CustomNode>

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl PartialEq for Box<dyn CustomNode>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Implementors§