pub struct Node {
    pub class: i32,
    pub brief: Option<Comment>,
    pub summary: Option<Comment>,
    pub data_type: Option<DataType>,
    pub data: Vec<Data>,
    pub node_type: Option<NodeType>,
}
Expand description

Nodes of the validator parse result tree.

Note that, unlike substrait.Plan and its children, the nodes in this tree are intentionally devoid of typing information: all nodes are of type Node. The purpose of this is to allow a consumer of these trees to walk over the entire tree without needing in-depth knowledge of how Substrait works (and, with that, to decouple them from changes to the Substrait specification): they are intended as an intermediate format for converting Substrait plans into more human-friendly representations after all, not for programmatically dealing with the semantics of Substrait itself. That’s what the validator is for, in this case.

In particular, gathering all diagnostics emitted by the validator only requires the consumer to use the Node, Node.Data, Node.Child, and of course the Diagnostic message types.

In case the consumer does need additional information from the original substrait.Plan, every node can be related back to its corresponding message via the path information associated with the nodes.

Fields

class: i32

Semantic classification of this node.

brief: Option<Comment>

Optional brief description of the node. Should not contain newlines or other non-span formatting information.

summary: Option<Comment>

Optional summary of the node. Unlike brief, this may contain paragraph-level formatting information.

data_type: Option<DataType>

For the following types of nodes, the validator will try to do type resolution:

  • type-like nodes resolve to said type;
  • expression-like nodes resolve to the type returned by the expression;
  • relation-like nodes resolve to the schema (as a named struct) returned by the relation. This field will be populated for such nodes even if resolution fails, to indicate that there is supposed to be a type. In that case, the type kind will be set to “unresolved.” The field will not be populated for nodes that don’t have a logical Substrait type.
data: Vec<Data>

Data associated with this node.

node_type: Option<NodeType>

The type of node.

Implementations

Returns the enum value of class, or the default if the field is set to an invalid enum value.

Sets class to the provided enum value.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Converts to this type from the input type.

Creates an empty output node for a protobuf datum of this type. Read more

Creates an empty output node for a protobuf datum with this value.

Returns the name of the selected variant of a oneof field, if this is a rust enum used to represent a oneof field. Read more

Complete the subtrees of this datum in output that have not already been parsed using UnknownField nodes. Returns whether any such nodes were added. Read more

Returns the encoded length of the message without a length delimiter.

Clears the message, resetting all fields to their default.

Encodes the message to a buffer. Read more

Encodes the message to a newly allocated buffer.

Encodes the message with a length-delimiter to a buffer. Read more

Encodes the message with a length-delimiter to a newly allocated buffer.

Decodes an instance of the message from a buffer. Read more

Decodes a length-delimited instance of the message from the buffer.

Decodes an instance of the message from a buffer, and merges it into self. Read more

Decodes a length-delimited instance of the message from buffer, and merges it into self. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Returns the protobuf type name for messages of this type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.