pub fn on_encoder_recv<R: Buf, W: BufMut>(
    table: &mut DynamicTableInserter,
    read: &mut R,
    write: &mut W,
) -> Result<usize, Error> {
    let inserted_on_start = table.total_inserted();

    while let Some(instruction) = parse_instruction(&table, read)? {
        trace!("instruction {:?}", instruction);
        match instruction {
            Instruction::Insert(field) => table.put_field(field)?,
            Instruction::TableSizeUpdate(size) => {
                table.set_max_size(size)?;
            }
        }
    }

    if table.total_inserted() != inserted_on_start {
        InsertCountIncrement(table.total_inserted() - inserted_on_start).encode(write);
    }

    Ok(table.total_inserted())
}
// The receiving side of encoder stream
The receiving side of encoder stream
The receiving side of encoder stream
pub fn on_encoder_recv<R: Buf, W: BufMut>(
    table: &mut DynamicTableInserter,
    read: &mut R,
    write: &mut W,
) -> Result<usize, Error> {
    let inserted_on_start = table.total_inserted();
    while let Some(instruction) = parse_instruction(&table, read)? {
        trace!("instruction {:?}", instruction);
        match instruction {
            Instruction::Insert(field) => table.put_field(field)?,
            Instruction::TableSizeUpdate(size) => {
                table.set_max_size(size)?;
            }
        }
    }
    if table.total_inserted() != inserted_on_start {
        InsertCountIncrement(table.total_inserted() - inserted_on_start).encode(write);
    }
    Ok(table.total_inserted())
}
pub fn on_encoder_recv < R : Buf , W : BufMut > ( table : & mut DynamicTableInserter , read : & mut R , write : & mut W , ) -> Result < usize , Error > { let inserted_on_start = table . total_inserted ( ) ; while let Some ( instruction ) = parse_instruction ( & table , read ) ? { trace ! ( " " instruction ) ; match instruction { Instruction :: Insert ( field ) => table . put_field ( field ) ? , Instruction :: TableSizeUpdate ( size ) => { table . set_max_size ( size ) ? ; } } } if table . total_inserted ( ) != inserted_on_start { InsertCountIncrement ( table . total_inserted ( ) - inserted_on_start ) . encode ( write ) ; } Ok ( table . total_inserted ( ) ) }
The receiving side of encoder stream
The receiving side of encoder stream
table
&mut DynamicTableInserter
read
&mut R
write
&mut W