Skip to main content

DynExpr

Trait DynExpr 

Source
pub trait DynExpr:
    Debug
    + Send
    + Sync {
    // Required method
    fn render_dyn(&self, buf: &mut String);

    // Provided method
    fn render_dyn_params(
        &self,
        buf: &mut String,
        _params: &mut BTreeMap<String, Value>,
    ) { ... }
}
Expand description

A type-erased expression that can render itself into a SurrealQL buffer. Implemented by every expression node; the common currency of the builder.

Required Methods§

Source

fn render_dyn(&self, buf: &mut String)

Append this expression’s SurrealQL to buf with all values inlined.

Provided Methods§

Source

fn render_dyn_params( &self, buf: &mut String, _params: &mut BTreeMap<String, Value>, )

Render with $param placeholders, collecting values into params. Default falls back to inline rendering; Literal nodes override this to emit $pN placeholders and collect their value.

Trait Implementations§

Source§

impl DynExpr for Box<dyn DynExpr>

Source§

fn render_dyn(&self, buf: &mut String)

Append this expression’s SurrealQL to buf with all values inlined.
Source§

fn render_dyn_params( &self, buf: &mut String, params: &mut BTreeMap<String, Value>, )

Render with $param placeholders, collecting values into params. Default falls back to inline rendering; Literal nodes override this to emit $pN placeholders and collect their value.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl DynExpr for Box<dyn DynExpr>

Source§

fn render_dyn(&self, buf: &mut String)

Source§

fn render_dyn_params( &self, buf: &mut String, params: &mut BTreeMap<String, Value>, )

Implementors§

Source§

impl DynExpr for AndExpr

Source§

impl DynExpr for Closure

Source§

impl DynExpr for ContainsExpr

Source§

impl DynExpr for EqExpr

Source§

impl DynExpr for Func

Source§

impl DynExpr for Grouped

Source§

impl DynExpr for GtExpr

Source§

impl DynExpr for GteExpr

Source§

impl DynExpr for Ident

Source§

impl DynExpr for IfExpr

Source§

impl DynExpr for InExpr

Source§

impl DynExpr for KnnExpr

Source§

impl DynExpr for LtExpr

Source§

impl DynExpr for LteExpr

Source§

impl DynExpr for MatchesExpr

Source§

impl DynExpr for NeExpr

Source§

impl DynExpr for NoneLit

Source§

impl DynExpr for NotExpr

Source§

impl DynExpr for NotInExpr

Source§

impl DynExpr for OrExpr

Source§

impl DynExpr for Path

Source§

impl DynExpr for Raw

Source§

impl<T: SurrealRecord, V: SurrealQL> DynExpr for Column<T, V>

Source§

impl<T: SurrealRecord> DynExpr for ColumnSet<T>

Source§

impl<T: SurrealRecord> DynExpr for Select<T>

A Select is usable as an expression — rendered parenthesized — so it can be embedded as a subquery: a scalar/IN operand in a WHERE, a projection, or a SET/FROM value. Params from the subquery merge into the parent’s map.

Source§

impl<V: SurrealQL> DynExpr for Literal<V>

Source§

impl<V: SurrealQL> DynExpr for Param<V>