Parent

Trait Parent 

Source
pub trait Parent<T: EsEntity>: Send {
    // Required methods
    fn new_children_mut(&mut self) -> &mut Vec<<T as EsEntity>::New>;
    fn iter_persisted_children_mut(
        &mut self,
    ) -> ValuesMut<'_, <<T as EsEntity>::Event as EsEvent>::EntityId, T>;
    fn inject_children(&mut self, entities: impl IntoIterator<Item = T>);
}
Expand description

Trait that entities implement for every field marked #[es_entity(nested)]

Will be auto-implemented when #[derive(EsEntity)] is used.

Required Methods§

Source

fn new_children_mut(&mut self) -> &mut Vec<<T as EsEntity>::New>

Access new child entities to persist them.

Source

fn iter_persisted_children_mut( &mut self, ) -> ValuesMut<'_, <<T as EsEntity>::Event as EsEvent>::EntityId, T>

Access existing children to update them incase they were mutated.

Source

fn inject_children(&mut self, entities: impl IntoIterator<Item = T>)

Inject hydrated children while loading the parent.

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§