fn flush_to_txn_ref(&mut self, writer: &mut Writer) -> SourceChainResult<()> {
        // Nothing to write
        if self.is_clean() {
            return Ok(());
        }

        // Writing a chain move
        let env = self.buf.env().clone();
        let db = env.get_db(&*CHAIN_SEQUENCE)?;
        let (_, _, persisted_head) = ChainSequenceBuf::head_info(&KvIntStore::new(db), writer)?;
        let persisted_head_moved = self.persisted_head != persisted_head;
        if persisted_head_moved && self.chain_moved_in_this_transaction() {
            Err(SourceChainError::HeadMoved(
                self.persisted_head.to_owned(),
                persisted_head,
            ))
        } else {
            Ok(self.buf.flush_to_txn_ref(writer)?)
        }
    }
/// Commit to the source chain, performing an as-at check and returning a
/// SourceChainError::HeadMoved error if the as-at check fails
Commit to the source chain, performing an as-at check and returning a
SourceChainError::HeadMoved error if the as-at check fails
Commit to the source chain performing an as - at check and returning a SourceChainError :: HeadMoved error if the as - at check fails
fn flush_to_txn_ref(&mut self, writer: &mut Writer) -> SourceChainResult<()> {
        // Nothing to write
        if self.is_clean() {
            return Ok(());
        }
        // Writing a chain move
        let env = self.buf.env().clone();
        let db = env.get_db(&*CHAIN_SEQUENCE)?;
        let (_, _, persisted_head) = ChainSequenceBuf::head_info(&KvIntStore::new(db), writer)?;
        let persisted_head_moved = self.persisted_head != persisted_head;
        if persisted_head_moved && self.chain_moved_in_this_transaction() {
            Err(SourceChainError::HeadMoved(
                self.persisted_head.to_owned(),
                persisted_head,
            ))
        } else {
            Ok(self.buf.flush_to_txn_ref(writer)?)
        }
    }
fn flush_to_txn_ref ( & mut self , writer : & mut Writer ) -> SourceChainResult < ( ) > { // Nothing to write if self . is_clean ( ) { return Ok ( ( ) ) ; } // Writing a chain move let env = self . buf . env ( ) . clone ( ) ; let db = env . get_db ( & * CHAIN_SEQUENCE ) ? ; let ( _ , _ , persisted_head ) = ChainSequenceBuf :: head_info ( & KvIntStore :: new ( db ) , writer ) ? ; let persisted_head_moved = self . persisted_head != persisted_head ; if persisted_head_moved && self . chain_moved_in_this_transaction ( ) { Err ( SourceChainError :: HeadMoved ( self . persisted_head . to_owned ( ) , persisted_head , ) ) } else { Ok ( self . buf . flush_to_txn_ref ( writer ) ? ) } }
Commit to the source chain, performing an as-at check and returning a
SourceChainError::HeadMoved error if the as-at check fails
Commit to the source chain performing an as - at check and returning a SourceChainError :: HeadMoved error if the as - at check fails
&mut self
writer
&mut Writer
&mut self
writer
&mut Writer