pub fn add_entity(
        &mut self,
        id: &Eid,
        entity: TransableRef,
        action: Action,
        ent_type: EntityType,
        arm: Arm,
    ) -> Result<()> {
        // add a wal entry
        self.wal.add_entry(id, action, ent_type, arm);
        self.wal_saved = false;

        // If the entity is a direct entity, such as Segment Data, we need to
        // save the wal now before writing to that entity. For the other types
        // of entities, the wal save is delayed before commit.
        if ent_type == EntityType::Direct {
            self.wal_armor.save_item(&mut self.wal).or_else(|err| {
                self.wal.remove_entry(id);
                Err(err)
            })?;
            self.wal_saved = true;
        }

        // add entity to cohorts
        self.cohorts.entry(id.clone()).or_insert(entity);

        Ok(())
    }
// add an entity to this transaction
add an entity to this transaction
add an entity to this transaction
pub fn add_entity(
        &mut self,
        id: &Eid,
        entity: TransableRef,
        action: Action,
        ent_type: EntityType,
        arm: Arm,
    ) -> Result<()> {
        // add a wal entry
        self.wal.add_entry(id, action, ent_type, arm);
        self.wal_saved = false;
        // If the entity is a direct entity, such as Segment Data, we need to
        // save the wal now before writing to that entity. For the other types
        // of entities, the wal save is delayed before commit.
        if ent_type == EntityType::Direct {
            self.wal_armor.save_item(&mut self.wal).or_else(|err| {
                self.wal.remove_entry(id);
                Err(err)
            })?;
            self.wal_saved = true;
        }
        // add entity to cohorts
        self.cohorts.entry(id.clone()).or_insert(entity);
        Ok(())
    }
pub fn add_entity ( & mut self , id : & Eid , entity : TransableRef , action : Action , ent_type : EntityType , arm : Arm , ) -> Result < ( ) > { // add a wal entry self . wal . add_entry ( id , action , ent_type , arm ) ; self . wal_saved = false ; // If the entity is a direct entity, such as Segment Data, we need to // save the wal now before writing to that entity. For the other types // of entities, the wal save is delayed before commit. if ent_type == EntityType :: Direct { self . wal_armor . save_item ( & mut self . wal ) . or_else ( | err | { self . wal . remove_entry ( id ) ; Err ( err ) } ) ? ; self . wal_saved = true ; } // add entity to cohorts self . cohorts . entry ( id . clone ( ) ) . or_insert ( entity ) ; Ok ( ( ) ) }
add an entity to this transaction
add an entity to this transaction
&mut self
id
&Eid
entity
TransableRef
action
Action
ent_type
EntityType
arm
Arm
&mut self
id
&Eid
entity
TransableRef
action
Action
ent_type
EntityType
arm
Arm