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
由宏为你的业务 struct 实现的 trait:提供字段元数据与取值/空值判断。
Required Associated Constants§
Required Methods§
Sourcefn is_empty_field(&self, rust_field: &'static str) -> bool
fn is_empty_field(&self, rust_field: &'static str) -> bool
判断某个字段是否“空值”(用于 omitempty)。
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.