SqlStruct

Trait SqlStruct 

Source
pub trait SqlStruct: Sized {
    const FIELDS: &'static [FieldMeta];

    // Required methods
    fn values(&self) -> Vec<Arg>;
    fn is_empty_field(&self, rust_field: &'static str) -> bool;
    fn addr_cells<'a>(
        &'a mut self,
        rust_fields: &[&'static str],
    ) -> Option<Vec<ScanCell<'a>>>;
}
Expand description

Trait implemented by the macro for your structs: exposes metadata, values, and emptiness checks.

Required Associated Constants§

Source

const FIELDS: &'static [FieldMeta]

Required Methods§

Source

fn values(&self) -> Vec<Arg>

Extract field values for INSERT/UPDATE (in FIELDS order).

Source

fn is_empty_field(&self, rust_field: &'static str) -> bool

Check whether a field is “empty” (used for omitempty).

Source

fn addr_cells<'a>( &'a mut self, rust_fields: &[&'static str], ) -> Option<Vec<ScanCell<'a>>>

Return writable scan targets for Struct::addr*.

Note: builds all ScanCells at once (internally holds raw pointers) to avoid borrow-checker conflicts.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§