pub trait NodeTrait<ET: EngineTypes>: Debug + Clone {
// Required methods
fn height(&self) -> ET::Dim;
fn depth(&self) -> ET::Dim;
fn width(&self) -> ET::Dim;
fn nodetype(&self) -> NodeType;
fn display_fmt(&self, indent: usize, f: &mut Formatter<'_>) -> Result;
// Provided methods
fn display(&self) -> DisplayNode<'_, ET, Self> { ... }
fn opaque(&self) -> bool { ... }
fn sourceref(&self) -> Option<(&SourceRef<ET>, &SourceRef<ET>)> { ... }
}Expand description
Common trait for all nodes that end up in the final document.
Required Methods§
Sourcefn display_fmt(&self, indent: usize, f: &mut Formatter<'_>) -> Result
fn display_fmt(&self, indent: usize, f: &mut Formatter<'_>) -> Result
Produces a human-readable string; since nodes are deeply nested, takes an
additional indent value to indent the string
Provided Methods§
Sourcefn display(&self) -> DisplayNode<'_, ET, Self>
fn display(&self) -> DisplayNode<'_, ET, Self>
Returns a helper struct that implements Display and uses Self::display_fmt
to yield a human-readable string.
Sourcefn opaque(&self) -> bool
fn opaque(&self) -> bool
Whether this node is “opaque”; meaning: When considering a list of nodes (e.g. in \unskip
or \lastbox, this node should not be considered. Useful for annotation/marker nodes
some engine wants to insert, without impacting algorithms that inspect e.g. the last node
of the current list.
fn sourceref(&self) -> Option<(&SourceRef<ET>, &SourceRef<ET>)>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.