use crate::db::query::plan::AggregateKind;
pub(in crate::db) trait AggregateExplain {
fn explain_aggregate_kind(&self) -> Option<AggregateKind>;
fn explain_projected_field(&self) -> Option<&str> {
None
}
}
pub(in crate::db) trait ProjectionExplain {
fn explain_projection_descriptor(&self) -> ProjectionExplainDescriptor<'_>;
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub(in crate::db) struct ProjectionExplainDescriptor<'a> {
pub(in crate::db::query::builder::aggregate) terminal: &'static str,
pub(in crate::db::query::builder::aggregate) field: &'a str,
pub(in crate::db::query::builder::aggregate) output: &'static str,
}
impl<'a> ProjectionExplainDescriptor<'a> {
#[must_use]
pub(in crate::db) const fn terminal_label(self) -> &'static str {
self.terminal
}
#[must_use]
pub(in crate::db) const fn field_label(self) -> &'a str {
self.field
}
#[must_use]
pub(in crate::db) const fn output_label(self) -> &'static str {
self.output
}
}