pub trait Explain<'a>: 'a {
    type Context;
    type Text: DisplayText;
    type Json: DisplayJson;
    type Dot: DisplayDot;

    fn explain(
        &'a mut self,
        format: &'a ExplainFormat,
        config: &'a ExplainConfig,
        context: &'a Self::Context
    ) -> Result<String, ExplainError> { ... } fn explain_text(
        &'a mut self,
        config: &'a ExplainConfig,
        context: &'a Self::Context
    ) -> Result<Self::Text, ExplainError> { ... } fn explain_json(
        &'a mut self,
        config: &'a ExplainConfig,
        context: &'a Self::Context
    ) -> Result<Self::Json, ExplainError> { ... } fn explain_dot(
        &'a mut self,
        config: &'a ExplainConfig,
        context: &'a Self::Context
    ) -> Result<Self::Dot, ExplainError> { ... } }
Expand description

A trait that provides a unified interface for objects that can be explained.

All possible subjects of the various forms of an EXPLAIN SQL statement should implement this trait.

Required Associated Types§

The type of the immutable context in which the explanation will be rendered.

The explanation type produced by a successful Explain::explain_text call.

The explanation type produced by a successful Explain::explain_json call.

The explanation type produced by a successful Explain::explain_json call.

Provided Methods§

Explain an instance of Self within the given Explain::Context.

Implementors should never have the need to not rely on this default implementation.

Errors

If the given format is not supported, the implementation should return an ExplainError::UnsupportedFormat.

If an ExplainConfig parameter cannot be honored, the implementation should silently ignore this paramter and proceed without returning a Result::Err.

Construct a Result::Ok of the Explain::Text format from the config and the context.

Errors

If the ExplainFormat::Text is not supported, the implementation should return an ExplainError::UnsupportedFormat.

If an ExplainConfig parameter cannot be honored, the implementation should silently ignore this paramter and proceed without returning a Result::Err.

Construct a Result::Ok of the Explain::Json format from the config and the context.

Errors

If the ExplainFormat::Text is not supported, the implementation should return an ExplainError::UnsupportedFormat.

If an ExplainConfig parameter cannot be honored, the implementation should silently ignore this paramter and proceed without returning a Result::Err.

Construct a Result::Ok of the Explain::Dot format from the config and the context.

Errors

If the ExplainFormat::Dot is not supported, the implementation should return an ExplainError::UnsupportedFormat.

If an ExplainConfig parameter cannot be honored, the implementation should silently ignore this paramter and proceed without returning a Result::Err.

Implementors§