Struct sql::plan::Explanation [−][src]
pub struct Explanation<'a> {
expr_humanizer: &'a dyn ExprHumanizer,
nodes: Vec<ExplanationNode<'a>>,
finishing: Option<RowSetFinishing>,
expr_chains: HashMap<*const HirRelationExpr, u64>,
local_id_chains: HashMap<LocalId, (String, u64)>,
chain_local_ids: HashMap<u64, (String, LocalId)>,
chain: u64,
}
Expand description
An Explanation
facilitates pretty-printing of a HirRelationExpr
.
By default, the fmt::Display
implementation renders the expression as
described in the module docs. Additional information may be attached to the
explanation via the other public methods on the type.
Fields
expr_humanizer: &'a dyn ExprHumanizer
nodes: Vec<ExplanationNode<'a>>
One ExplanationNode
for each HirRelationExpr
in the plan, in
left-to-right post-order.
finishing: Option<RowSetFinishing>
An optional RowSetFinishing
to mention at the end.
expr_chains: HashMap<*const HirRelationExpr, u64>
Records the chain ID that was assigned to each expression.
local_id_chains: HashMap<LocalId, (String, u64)>
Records the chain ID that was assigned to each let.
chain_local_ids: HashMap<u64, (String, LocalId)>
Records the local ID that corresponds to a chain ID, if any.
chain: u64
The ID of the current chain. Incremented while constructing the
Explanation
.
Implementations
pub fn new(
expr: &'a HirRelationExpr,
expr_humanizer: &'a dyn ExprHumanizer
) -> Explanation<'a>
pub fn new(
expr: &'a HirRelationExpr,
expr_humanizer: &'a dyn ExprHumanizer
) -> Explanation<'a>
Creates an explanation for a HirRelationExpr
.
pub fn new_internal(
expr: &'a HirRelationExpr,
expr_humanizer: &'a dyn ExprHumanizer,
id_gen: &mut IdGen,
local_id_chains: HashMap<LocalId, (String, u64)>
) -> Explanation<'a>
Attach type information into the explanation.
fn explain_types_internal(
&mut self,
outers: &[RelationType],
params: &BTreeMap<usize, ScalarType>
)
Attach a RowSetFinishing
to the explanation.
Retrieves the chain ID for the specified expression.
The ExplanationNode
for expr
must have already been inserted into
the explanation.
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Explanation<'a>
impl<'a> !Send for Explanation<'a>
impl<'a> !Sync for Explanation<'a>
impl<'a> Unpin for Explanation<'a>
impl<'a> !UnwindSafe for Explanation<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
Formats an object with the “alternative” format ({:#}
) and returns it.
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more