pub trait DbExpression<T>:
Clone
+ Send
+ Sync
+ 'static {
// Required method
fn render(&self, ctx: &mut ExprRenderCtx<'_>) -> Result<String, QueryError>;
// Provided methods
fn args(&self) -> FunctionArgs { ... }
fn validate(&self, _dialect: Dialect) -> Result<(), QueryError> { ... }
}Expand description
Advanced hook for typed custom expressions.
Prefer DbFunction for ordinary function calls. Use this hook when a
dialect-specific expression cannot be represented as name(arg, ...).
Required Methods§
Sourcefn render(&self, ctx: &mut ExprRenderCtx<'_>) -> Result<String, QueryError>
fn render(&self, ctx: &mut ExprRenderCtx<'_>) -> Result<String, QueryError>
Renders this expression with pre-rendered child expression access.
Provided Methods§
Sourcefn args(&self) -> FunctionArgs
fn args(&self) -> FunctionArgs
Returns child expressions used by this custom expression.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".