pub struct Node {
pub class: Class,
pub brief: Option<Brief>,
pub summary: Option<Comment>,
pub node_type: NodeType,
pub data_type: Option<Type>,
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<Type>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§
Source§impl Node
impl Node
Sourcepub fn iter_flattened_nodes(&self) -> FlattenedNodeIter<'_> ⓘ
pub fn iter_flattened_nodes(&self) -> FlattenedNodeIter<'_> ⓘ
Returns an iterator that iterates over all nodes depth-first.
Sourcepub fn iter_flattened_node_data(&self) -> FlattenedNodeDataIter<'_> ⓘ
pub fn iter_flattened_node_data(&self) -> FlattenedNodeDataIter<'_> ⓘ
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 Freeze for Node
impl !RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl !UnwindSafe for Node
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointerSource§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more