Expression

Trait Expression 

Source
pub trait Expression:
    OpPrecedence
    + Send
    + Sync
    + Debug {
    // Required method
    fn write_query(
        &self,
        writer: &dyn SqlWriter,
        context: &mut Context,
        out: &mut String,
    );

    // Provided methods
    fn is_ordered(&self) -> bool { ... }
    fn is_true(&self) -> bool { ... }
}
Expand description

Renderable SQL expression.

Required Methods§

Source

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

Serialize the expression into out using writer.

Provided Methods§

Source

fn is_ordered(&self) -> bool

True if it encodes ordering.

Source

fn is_true(&self) -> bool

True if it is an expression that simply evaluates to true

Trait Implementations§

Source§

impl Expression for &dyn Expression

Source§

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

Serialize the expression into out using writer.
Source§

fn is_ordered(&self) -> bool

True if it encodes ordering.
Source§

fn is_true(&self) -> bool

True if it is an expression that simply evaluates to true
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 String, )

Source§

impl Expression for bool

Source§

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

Source§

fn is_true(&self) -> bool

Source§

impl Expression for ()

Source§

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

Source§

impl<T: Expression> Expression for &T

Source§

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

Source§

fn is_ordered(&self) -> bool

Source§

fn is_true(&self) -> bool

Implementors§