fn cut_row_v1(data: Vec<u8>, cols: &HashSet<i64>) -> Result<RowColsDict> {
    let meta_map = {
        let mut meta_map = HashMap::with_capacity_and_hasher(cols.len(), Default::default());
        let length = data.len();
        let mut tmp_data: &[u8] = data.as_ref();
        while !tmp_data.is_empty() && meta_map.len() < cols.len() {
            let id = tmp_data.read_datum()?.i64();
            let offset = length - tmp_data.len();
            let (val, rem) = datum::split_datum(tmp_data, false)?;
            if cols.contains(&id) {
                meta_map.insert(id, RowColMeta::new(offset, val.len()));
            }
            tmp_data = rem;
        }
        meta_map
    };
    Ok(RowColsDict::new(meta_map, data))
}
/// Cuts a non-empty row in row format v1.
Cuts a non-empty row in row format v1.
Cuts a non - empty row in row format v1 .
fn cut_row_v1(data: Vec<u8>, cols: &HashSet<i64>) -> Result<RowColsDict> {
    let meta_map = {
        let mut meta_map = HashMap::with_capacity_and_hasher(cols.len(), Default::default());
        let length = data.len();
        let mut tmp_data: &[u8] = data.as_ref();
        while !tmp_data.is_empty() && meta_map.len() < cols.len() {
            let id = tmp_data.read_datum()?.i64();
            let offset = length - tmp_data.len();
            let (val, rem) = datum::split_datum(tmp_data, false)?;
            if cols.contains(&id) {
                meta_map.insert(id, RowColMeta::new(offset, val.len()));
            }
            tmp_data = rem;
        }
        meta_map
    };
    Ok(RowColsDict::new(meta_map, data))
}
fn cut_row_v1 ( data : Vec < u8 > , cols : & HashSet < i64 > ) -> Result < RowColsDict > { let meta_map = { let mut meta_map = HashMap :: with_capacity_and_hasher ( cols . len ( ) , Default :: default ( ) ) ; let length = data . len ( ) ; let mut tmp_data : & [ u8 ] = data . as_ref ( ) ; while ! tmp_data . is_empty ( ) && meta_map . len ( ) < cols . len ( ) { let id = tmp_data . read_datum ( ) ? . i64 ( ) ; let offset = length - tmp_data . len ( ) ; let ( val , rem ) = datum :: split_datum ( tmp_data , false ) ? ; if cols . contains ( & id ) { meta_map . insert ( id , RowColMeta :: new ( offset , val . len ( ) ) ) ; } tmp_data = rem ; } meta_map } ; Ok ( RowColsDict :: new ( meta_map , data ) ) }
Cuts a non-empty row in row format v1.
Cuts a non - empty row in row format v1 .
data
Vec<u8>
cols
&HashSet<i64>