Skip to main content

Expression

Trait Expression 

Source
pub trait Expression:
    OpPrecedence
    + Send
    + Sync
    + Debug {
    // Required methods
    fn write_query(
        &self,
        writer: &dyn SqlWriter,
        context: &mut Context,
        out: &mut DynQuery,
    );
    fn accept_visitor(
        &self,
        matcher: &mut dyn ExpressionVisitor,
        writer: &dyn SqlWriter,
        context: &mut Context,
        _out: &mut DynQuery,
    ) -> bool;

    // Provided method
    fn as_identifier(&self, context: &mut Context) -> String { ... }
}
Expand description

Renderable SQL expression.

Required Methods§

Source

fn write_query( &self, writer: &dyn SqlWriter, context: &mut Context, out: &mut DynQuery, )

Render the expression into SQL.

Source

fn accept_visitor( &self, matcher: &mut dyn ExpressionVisitor, writer: &dyn SqlWriter, context: &mut Context, _out: &mut DynQuery, ) -> bool

Match the expression.

Provided Methods§

Source

fn as_identifier(&self, context: &mut Context) -> String

Convert expression to an identifier string.

Trait Implementations§

Source§

impl Expression for &dyn Expression

Source§

fn write_query( &self, writer: &dyn SqlWriter, context: &mut Context, out: &mut DynQuery, )

Render the expression into SQL.
Source§

fn accept_visitor( &self, matcher: &mut dyn ExpressionVisitor, writer: &dyn SqlWriter, context: &mut Context, out: &mut DynQuery, ) -> bool

Match the expression.
Source§

fn as_identifier(&self, context: &mut Context) -> String

Convert expression to an identifier string.
Source§

impl<'a, T: Expression> From<&'a T> for &'a dyn Expression

Source§

fn from(value: &'a T) -> Self

Converts to this type from the input type.
Source§

impl OpPrecedence for &dyn Expression

Source§

fn precedence(&self, writer: &dyn SqlWriter) -> i32

Lower numbers bind weaker, writers parenthesize when child precedence <= operator precedence.

Implementations on Foreign Types§

Source§

impl Expression for &'static str

Source§

fn write_query( &self, writer: &dyn SqlWriter, context: &mut Context, out: &mut DynQuery, )

Source§

fn accept_visitor( &self, matcher: &mut dyn ExpressionVisitor, writer: &dyn SqlWriter, context: &mut Context, out: &mut DynQuery, ) -> bool

Source§

impl Expression for bool

Source§

fn write_query( &self, writer: &dyn SqlWriter, context: &mut Context, out: &mut DynQuery, )

Source§

fn accept_visitor( &self, matcher: &mut dyn ExpressionVisitor, writer: &dyn SqlWriter, context: &mut Context, out: &mut DynQuery, ) -> bool

Source§

impl Expression for ()

Source§

fn write_query( &self, _writer: &dyn SqlWriter, _context: &mut Context, _out: &mut DynQuery, )

Source§

fn accept_visitor( &self, _matcher: &mut dyn ExpressionVisitor, _writer: &dyn SqlWriter, _context: &mut Context, _out: &mut DynQuery, ) -> bool

Source§

impl<T: Expression> Expression for &T

Source§

fn write_query( &self, writer: &dyn SqlWriter, context: &mut Context, out: &mut DynQuery, )

Source§

fn accept_visitor( &self, matcher: &mut dyn ExpressionVisitor, writer: &dyn SqlWriter, context: &mut Context, out: &mut DynQuery, ) -> bool

Source§

fn as_identifier(&self, context: &mut Context) -> String

Implementors§