pub trait ILazyInit: IEntityType {
// Required method
fn attach_lazy_contexts(
&mut self,
provider: Arc<dyn IDatabaseProvider>,
filter_map: Option<Arc<HashMap<String, CompiledFilter>>>,
depth: usize,
);
}Expand description
Attaches lazy-loading contexts to navigation properties.
Auto-generated by #[derive(EntityType)]. Called by QueryBuilder::to_list()
when lazy loading is enabled on the DbContext. For each navigation field,
the macro implementation constructs a LazyContextImpl and calls
set_lazy_context on the corresponding container.
Entities without navigation properties get a no-op implementation.
Required Methods§
Sourcefn attach_lazy_contexts(
&mut self,
provider: Arc<dyn IDatabaseProvider>,
filter_map: Option<Arc<HashMap<String, CompiledFilter>>>,
depth: usize,
)
fn attach_lazy_contexts( &mut self, provider: Arc<dyn IDatabaseProvider>, filter_map: Option<Arc<HashMap<String, CompiledFilter>>>, depth: usize, )
Attaches lazy contexts to all navigation properties on this entity.
depth is the current recursion depth (0 for top-level entities
materialized by to_list). Each lazy load() call increments the
depth when attaching contexts to child entities.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".