Skip to main content

IntoExpr

Trait IntoExpr 

Source
pub trait IntoExpr {
    // Required method
    fn into_expr(self) -> Expr;
}
Expand description

Conversion trait for types that can be turned into an Expr.

This trait is implemented for:

  • Expr – returned as-is.
  • &str and String – converted to a column reference via col().
  • Expression – wrapped directly in an Expr.

Note: &str/String inputs are treated as identifiers, not SQL string literals. Use lit() for literal values.

It is used as a generic bound throughout the builder API so that functions like select(), SelectBuilder::order_by(), and SelectBuilder::group_by() can accept plain strings, Expr values, or raw Expression nodes interchangeably.

Required Methods§

Source

fn into_expr(self) -> Expr

Convert this value into an Expr.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl IntoExpr for &str

Source§

fn into_expr(self) -> Expr

Convert a string slice to a column reference via col().

Source§

impl IntoExpr for String

Source§

fn into_expr(self) -> Expr

Convert an owned string to a column reference via col().

Implementors§