pub struct Node {
pub class: Class,
pub brief: Option<Brief>,
pub summary: Option<Comment>,
pub node_type: NodeType,
pub data_type: Option<Arc<DataType>>,
pub data: Vec<NodeData>,
}Expand description
Node for a semi-structured documentation-like tree representation of a parsed Substrait plan. The intention is for this to be serialized into some human-readable format.
Note: although it should be possible to reconstruct the entire plan from the information contained in the tree, the tree is only intended to be converted to structured human-readable documentation for the plan. It is expressly NOT intended to be read as a form of AST by a downstream process, and therefore isn’t nearly as strictly-typed as you would otherwise want it to be. Protobuf itself is already a reasonable format for this!
Fields
class: ClassThe type of a node in terms of plan semantics.
brief: Option<Brief>An optional brief description of the node. This can be regarded as a comment placed at the start of the data vector, but it is usually only set at the end of the parse function.
summary: Option<Comment>An optional comment summarizing what this node does. This can be regarded as a comment placed at the start of the data vector (just after brief, if brief is also defined), but it is usually only set at the end of the parse function.
node_type: NodeTypeThe type of node in terms of what it represents in the original data structure.
data_type: Option<Arc<DataType>>The type of data returned by this node, if any. Depending on the message and context, this may represent a table schema or scalar data.
data: Vec<NodeData>The information gathered about the message.
This normally includes all child nodes for this message, possibly interspersed with diagnostics, type information, and unstructured comment nodes to provide context, all ordered in a reasonable way. Note however that this information is intended to be understood by a human, not by the validator itself (aside from serialization to a human-readable notation).
Implementations
sourceimpl Node
impl Node
sourcepub fn iter_flattened_nodes(&self) -> FlattenedNodeIter<'_>ⓘNotable traits for FlattenedNodeIter<'a>impl<'a> Iterator for FlattenedNodeIter<'a> type Item = &'a Node;
pub fn iter_flattened_nodes(&self) -> FlattenedNodeIter<'_>ⓘNotable traits for FlattenedNodeIter<'a>impl<'a> Iterator for FlattenedNodeIter<'a> type Item = &'a Node;
Returns an iterator that iterates over all nodes depth-first.
sourcepub fn iter_flattened_node_data(&self) -> FlattenedNodeDataIter<'_>ⓘNotable traits for FlattenedNodeDataIter<'a>impl<'a> Iterator for FlattenedNodeDataIter<'a> type Item = &'a NodeData;
pub fn iter_flattened_node_data(&self) -> FlattenedNodeDataIter<'_>ⓘNotable traits for FlattenedNodeDataIter<'a>impl<'a> Iterator for FlattenedNodeDataIter<'a> type Item = &'a NodeData;
Returns an iterator that iterates over all NodeData objects in the order in which they were defined.
sourcepub fn iter_diagnostics(&self) -> impl Iterator<Item = &Diagnostic> + '_
pub fn iter_diagnostics(&self) -> impl Iterator<Item = &Diagnostic> + '_
Iterates over all diagnostics in the tree.
sourcepub fn get_diagnostic(&self) -> Option<&Diagnostic>
pub fn get_diagnostic(&self) -> Option<&Diagnostic>
Returns the first diagnostic of the highest severity level in the tree.
Trait Implementations
impl StructuralPartialEq for Node
Auto Trait Implementations
impl !RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl !UnwindSafe for Node
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more