TreeInsert

Trait TreeInsert 

Source
pub trait TreeInsert {
    // Required methods
    fn columns<'a, I>(descendents: I) -> Result<SqlExpr, ToqlError>
       where I: Iterator<Item = FieldPath<'a>>;
    fn values<'a, 'b, I, J>(
        &self,
        descendents: I,
        roles: &HashSet<String>,
        should_insert: &mut J,
        values: &mut SqlExpr,
    ) -> Result<(), ToqlError>
       where I: Iterator<Item = FieldPath<'a>> + Clone,
             J: Iterator<Item = &'b bool>;
}
Expand description

The trait allows to build the INSERT SQL statement for nested structs.

Required Methods§

Source

fn columns<'a, I>(descendents: I) -> Result<SqlExpr, ToqlError>
where I: Iterator<Item = FieldPath<'a>>,

Return columns of struct located at descendents.

Source

fn values<'a, 'b, I, J>( &self, descendents: I, roles: &HashSet<String>, should_insert: &mut J, values: &mut SqlExpr, ) -> Result<(), ToqlError>
where I: Iterator<Item = FieldPath<'a>> + Clone, J: Iterator<Item = &'b bool>,

Return values of structs located at descendents. The should_insert argument allows the method to only insert a part of the collection. This is needed to deal with newly added merges.

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§

Source§

impl<T> TreeInsert for Join<T>
where T: Keyed + TreeInsert + Mapped, <T as Keyed>::Key: Key + Clone,