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 Json = <DataflowDescription<Plan> as Explain<'a>>::Json;
24
25    type Dot = <DataflowDescription<Plan> as Explain<'a>>::Dot;
26
27    fn explain_text(&'a mut self, context: &'a Self::Context) -> Result<Self::Text, ExplainError> {
28        self.0.explain_text(context)
29    }
30
31    fn explain_json(&'a mut self, context: &'a Self::Context) -> Result<Self::Json, ExplainError> {
32        self.0.explain_json(context)
33    }
34
35    fn explain_dot(&'a mut self, context: &'a Self::Context) -> Result<Self::Dot, ExplainError> {
36        self.0.explain_dot(context)
37    }
38}