mz_adapter/explain/
lir.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 LIR structures.
11
12use mz_compute_types::dataflows::DataflowDescription;
13use mz_compute_types::plan::Plan;
14use mz_repr::explain::{Explain, ExplainError};
15
16use crate::explain::Explainable;
17
18impl<'a> Explain<'a> for Explainable<'a, DataflowDescription<Plan>> {
19    type Context = <DataflowDescription<Plan> as Explain<'a>>::Context;
20
21    type Text = <DataflowDescription<Plan> as Explain<'a>>::Text;
22
23    type VerboseText = <DataflowDescription<Plan> as Explain<'a>>::VerboseText;
24
25    type Json = <DataflowDescription<Plan> as Explain<'a>>::Json;
26
27    type Dot = <DataflowDescription<Plan> as Explain<'a>>::Dot;
28
29    fn explain_text(&'a mut self, context: &'a Self::Context) -> Result<Self::Text, ExplainError> {
30        self.0.explain_text(context)
31    }
32
33    fn explain_verbose_text(
34        &'a mut self,
35        context: &'a Self::Context,
36    ) -> Result<Self::VerboseText, ExplainError> {
37        self.0.explain_verbose_text(context)
38    }
39
40    fn explain_json(&'a mut self, context: &'a Self::Context) -> Result<Self::Json, ExplainError> {
41        self.0.explain_json(context)
42    }
43
44    fn explain_dot(&'a mut self, context: &'a Self::Context) -> Result<Self::Dot, ExplainError> {
45        self.0.explain_dot(context)
46    }
47}