pub fn bin_file_block_of_insert<Key, Value>(key: &Key, value: Value, integrity: &mut Option<Integrity>)
    -> Result<Vec<u8>, bincode2::Error>
where
    Key: Serialize,
    Value: Serialize
{
    let key_val_bin_data = bincode2::serialize(&(&key, &value))?;
    let mut data = vec![INSERT];
    data.extend_from_slice(&key_val_bin_data);
    post_process_file_bin_block(&mut data, integrity);
    let mut res = bin_block_len(data.len());
    res.extend_from_slice(&data);
    Ok(res)
}
/// Make data block with insert operation for write to file.
Make data block with insert operation for write to file.
Make data block with insert operation for write to file .
pub fn bin_file_block_of_insert<Key, Value>(key: &Key, value: Value, integrity: &mut Option<Integrity>)
    -> Result<Vec<u8>, bincode2::Error>
where
    Key: Serialize,
    Value: Serialize
{
    let key_val_bin_data = bincode2::serialize(&(&key, &value))?;
    let mut data = vec![INSERT];
    data.extend_from_slice(&key_val_bin_data);
    post_process_file_bin_block(&mut data, integrity);
    let mut res = bin_block_len(data.len());
    res.extend_from_slice(&data);
    Ok(res)
}
pub fn bin_file_block_of_insert < Key , Value > ( key : & Key , value : Value , integrity : & mut Option < Integrity > ) -> Result < Vec < u8 > , bincode2 :: Error > where Key : Serialize , Value : Serialize { let key_val_bin_data = bincode2 :: serialize ( & ( & key , & value ) ) ? ; let mut data = vec ! [ INSERT ] ; data . extend_from_slice ( & key_val_bin_data ) ; post_process_file_bin_block ( & mut data , integrity ) ; let mut res = bin_block_len ( data . len ( ) ) ; res . extend_from_slice ( & data ) ; Ok ( res ) }
Make data block with insert operation for write to file.
Make data block with insert operation for write to file .
key
&Key
value
Value
integrity
&mut Option<Integrity>
key
&Key
value
Value
integrity
&mut Option<Integrity>