pub trait KeyedUpdate<Entity: Deref>where
    Entity::Target: KeyValue,{
    type Targets<'targets>: Iterator<Item = &'targets <Entity::Target as KeyValue>::Key> + 'targets
       where Self: 'targets,
             <Entity::Target as KeyValue>::Key: 'targets,
             Entity: 'targets;

    // Required methods
    fn size(&self) -> u32;
    fn targets<'targets>(
        &'targets self,
        entity: &'targets Entity
    ) -> Self::Targets<'targets>;
    fn keys_diff(
        &self,
        entity: &Entity
    ) -> MultiTargetUpdate<<Entity::Target as KeyValue>::Key, AddOrRemoveOrModify<()>>;

    // Provided method
    fn record_inner_keys_diff<K: Ord + Clone>(
        &self,
        entity: &Entity,
        inner_key: K,
        map: &mut MultiTargetUpdate<<Entity::Target as KeyValue>::Key, MultiTargetUpdate<K, AddOrRemoveOrModify<()>>>
    ) -> Result<(), DuplicateKey> { ... }
}
Expand description

Series of updates applied over some targets.

Required Associated Types§

source

type Targets<'targets>: Iterator<Item = &'targets <Entity::Target as KeyValue>::Key> + 'targets where Self: 'targets, <Entity::Target as KeyValue>::Key: 'targets, Entity: 'targets

Required Methods§

source

fn size(&self) -> u32

source

fn targets<'targets>( &'targets self, entity: &'targets Entity ) -> Self::Targets<'targets>

source

fn keys_diff( &self, entity: &Entity ) -> MultiTargetUpdate<<Entity::Target as KeyValue>::Key, AddOrRemoveOrModify<()>>

Provided Methods§

source

fn record_inner_keys_diff<K: Ord + Clone>( &self, entity: &Entity, inner_key: K, map: &mut MultiTargetUpdate<<Entity::Target as KeyValue>::Key, MultiTargetUpdate<K, AddOrRemoveOrModify<()>>> ) -> Result<(), DuplicateKey>

Implementors§

source§

impl<U, C> KeyedUpdate<C> for SetOrModify<C, U>where C: DerefMut, C::Target: KeyValue, U: KeyedUpdate<C>,

§

type Targets<'a> where Self: 'a, <C::Target as KeyValue>::Key: 'a, C: 'a = Either<Chain<<<C as Deref>::Target as KeyValue>::Keys<'a>, <<C as Deref>::Target as KeyValue>::Keys<'a>>, <U as KeyedUpdate<C>>::Targets<'a>>

source§

impl<U, C> KeyedUpdate<C> for MultiTargetUpdate<<C::Target as KeyValue>::Key, U>where C: DerefMut, U: GetUpdateKind<Option<<C::Target as KeyValue>::Value>>, C::Target: KeyValue,

§

type Targets<'a> where Self: 'a, <C::Target as KeyValue>::Key: 'a, C: 'a = Keys<'a, <<C as Deref>::Target as KeyValue>::Key, U>

source§

impl<U, C> KeyedUpdate<C> for SingleTargetUpdate<<C::Target as KeyValue>::Key, U>where C: DerefMut, U: GetUpdateKind<Option<<C::Target as KeyValue>::Value>>, C::Target: KeyValue,

§

type Targets<'a> where U: 'a, C: 'a, <C::Target as KeyValue>::Key: 'a = Once<&'a <<C as Deref>::Target as KeyValue>::Key>