Trait mz_repr::explain::ExprHumanizer
source · pub trait ExprHumanizer: Debug {
// Required methods
fn humanize_id(&self, id: GlobalId) -> Option<String>;
fn humanize_id_unqualified(&self, id: GlobalId) -> Option<String>;
fn humanize_id_parts(&self, id: GlobalId) -> Option<Vec<String>>;
fn humanize_scalar_type(&self, ty: &ScalarType) -> String;
fn column_names_for_id(&self, id: GlobalId) -> Option<Vec<String>>;
fn humanize_column(&self, id: GlobalId, column: usize) -> Option<String>;
fn id_exists(&self, id: GlobalId) -> bool;
// Provided method
fn humanize_column_type(&self, typ: &ColumnType) -> String { ... }
}
Expand description
A trait for humanizing components of an expression.
This will be most often used as part of the rendering context
type for various Display$Format
implementation.
Required Methods§
sourcefn humanize_id(&self, id: GlobalId) -> Option<String>
fn humanize_id(&self, id: GlobalId) -> Option<String>
Attempts to return a human-readable string for the relation
identified by id
.
sourcefn humanize_id_unqualified(&self, id: GlobalId) -> Option<String>
fn humanize_id_unqualified(&self, id: GlobalId) -> Option<String>
Same as above, but without qualifications, e.g., only foo
for materialize.public.foo
.
sourcefn humanize_id_parts(&self, id: GlobalId) -> Option<Vec<String>>
fn humanize_id_parts(&self, id: GlobalId) -> Option<Vec<String>>
Like Self::humanize_id
, but returns the constituent parts of the
name as individual elements.
sourcefn humanize_scalar_type(&self, ty: &ScalarType) -> String
fn humanize_scalar_type(&self, ty: &ScalarType) -> String
Returns a human-readable name for the specified scalar type.
sourcefn column_names_for_id(&self, id: GlobalId) -> Option<Vec<String>>
fn column_names_for_id(&self, id: GlobalId) -> Option<Vec<String>>
Returns a vector of column names for the relation identified by id
.
Provided Methods§
sourcefn humanize_column_type(&self, typ: &ColumnType) -> String
fn humanize_column_type(&self, typ: &ColumnType) -> String
Returns a human-readable name for the specified column type.
Trait Implementations§
source§impl<'a, T> AsRef<&'a dyn ExprHumanizer> for PlanRenderingContext<'a, T>
impl<'a, T> AsRef<&'a dyn ExprHumanizer> for PlanRenderingContext<'a, T>
source§fn as_ref(&self) -> &&'a dyn ExprHumanizer
fn as_ref(&self) -> &&'a dyn ExprHumanizer
Converts this type into a shared reference of the (usually inferred) input type.
source§impl<'a> AsRef<&'a dyn ExprHumanizer> for RenderingContext<'a>
impl<'a> AsRef<&'a dyn ExprHumanizer> for RenderingContext<'a>
source§fn as_ref(&self) -> &&'a dyn ExprHumanizer
fn as_ref(&self) -> &&'a dyn ExprHumanizer
Converts this type into a shared reference of the (usually inferred) input type.