Trait HasFields

Source
pub trait HasFields {
    // Required methods
    fn not_none_fields<'a>(self) -> Vec<Field<'a>>;
    fn all_fields<'a>(self) -> Vec<Field<'a>>;
    fn field_names() -> &'static [&'static str];
}
Expand description

Implement that this struct have “fields” that can be expressed as (name, value) vector. Typically implemented with #[derive(Fields)]

Required Methods§

Source

fn not_none_fields<'a>(self) -> Vec<Field<'a>>

Consume and returns the Field(name, value) where the value is a not none SqlxBindable.

Source

fn all_fields<'a>(self) -> Vec<Field<'a>>

Consume and returns the Field(name, value) where the value is a SqlxBindable.

Source

fn field_names() -> &'static [&'static str]

Return the array of all field names this struct has.

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§