mz_adapter/explain/
hir.rs

1// Copyright Materialize, Inc. and contributors. All rights reserved.
2//
3// Use of this software is governed by the Business Source License
4// included in the LICENSE file.
5//
6// As of the Change Date specified in that file, in accordance with
7// the Business Source License, use of this software will be governed
8// by the Apache License, Version 2.0.
9
10//! `EXPLAIN` support for HIR structures.
11
12use mz_repr::explain::{Explain, ExplainError};
13use mz_sql::plan::HirRelationExpr;
14
15use crate::explain::Explainable;
16
17impl<'a> Explain<'a> for Explainable<'a, HirRelationExpr> {
18    type Context = <HirRelationExpr as Explain<'a>>::Context;
19
20    type Text = <HirRelationExpr as Explain<'a>>::Text;
21
22    type VerboseText = <HirRelationExpr as Explain<'a>>::VerboseText;
23
24    type Json = <HirRelationExpr as Explain<'a>>::Json;
25
26    type Dot = <HirRelationExpr as Explain<'a>>::Dot;
27
28    fn explain_text(&'a mut self, context: &'a Self::Context) -> Result<Self::Text, ExplainError> {
29        self.0.explain_text(context)
30    }
31
32    fn explain_verbose_text(
33        &'a mut self,
34        context: &'a Self::Context,
35    ) -> Result<Self::VerboseText, ExplainError> {
36        self.0.explain_verbose_text(context)
37    }
38
39    fn explain_json(&'a mut self, context: &'a Self::Context) -> Result<Self::Json, ExplainError> {
40        self.0.explain_json(context)
41    }
42
43    fn explain_dot(&'a mut self, context: &'a Self::Context) -> Result<Self::Dot, ExplainError> {
44        self.0.explain_dot(context)
45    }
46}