Skip to main content

INavigationSetter

Trait INavigationSetter 

Source
pub trait INavigationSetter: IEntityType {
    // Provided methods
    fn apply_has_many(
        &mut self,
        field: &str,
        rows: &[Vec<DbValue>],
    ) -> EFResult<()> { ... }
    fn apply_reference(&mut self, field: &str, row: &[DbValue]) -> EFResult<()> { ... }
    fn drain_has_many(
        &mut self,
        field: &str,
    ) -> Option<Vec<Box<dyn Any + Send + Sync>>> { ... }
    fn load_nested_includes<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        entities: &'life0 mut [Self],
        parent_navigation: &'life1 str,
        nested: &'life2 [IncludePath],
        provider: &'life3 dyn IDatabaseProvider,
        filter_map: Option<&'life4 HashMap<String, CompiledFilter>>,
    ) -> Pin<Box<dyn Future<Output = EFResult<()>> + Send + 'async_trait>>
       where Self: Sized + Send + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait { ... }
}
Expand description

Applies eagerly-loaded navigation data to an entity.

Auto-generated by #[derive(EntityType)] for types with navigation properties.

Provided Methods§

Source

fn apply_has_many(&mut self, field: &str, rows: &[Vec<DbValue>]) -> EFResult<()>

Source

fn apply_reference(&mut self, field: &str, row: &[DbValue]) -> EFResult<()>

Source

fn drain_has_many( &mut self, field: &str, ) -> Option<Vec<Box<dyn Any + Send + Sync>>>

Drains all items from a HasMany navigation field, returning them as type-erased boxed values. The container is left empty after this call.

Used by the cascade save pipeline to extract Added children from principal entities before INSERT. Returns None if the field is not a HasMany navigation or the container is empty.

The #[derive(EntityType)] macro overrides this for each HasMany field.

Source

fn load_nested_includes<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( entities: &'life0 mut [Self], parent_navigation: &'life1 str, nested: &'life2 [IncludePath], provider: &'life3 dyn IDatabaseProvider, filter_map: Option<&'life4 HashMap<String, CompiledFilter>>, ) -> Pin<Box<dyn Future<Output = EFResult<()>> + Send + 'async_trait>>
where Self: Sized + Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Loads nested includes across multiple entities in batch.

Collects children for parent_navigation across all entities, batch-loads their nested includes with a single SQL query per level (avoids N+1), then recurses for deeper ThenInclude levels.

filter_map carries per-table query filters (e.g. tenant isolation) so that nested navigation loading respects the same filters as top-level loading.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§